SORTING AND SEARCHING - Java Codes

Convert Infix to Postfix

Description This program is a sample to convert Infix expression to Postfix Source Code import java.io.IOException; public class InToPost { private Stack theStack; private String input; p ...

0 Comments. 1043 views since Aug 29, 2008

QuickSort

Description This is a code for Quick Sort in Java. Source Code public class QuickSort { private long[] data; private int len; public QuickSort(int max) { data = new long[max]; len ...

0 Comments. 937 views since Sep 7, 2008

String Sorting

Description This code shows Sorting of String but with the help of Utility class. Source Code import java.util.Arrays; public class StringSort { public static void main(String[] args) { String ...

0 Comments. 896 views since Sep 7, 2008

Selection Sort

Description This is a code for Selection Sort in Java. Source Code public class SelectionSort { private long[] a; private int nElems; public SelectionSort(int max) { a = new long[max]; ...

0 Comments. 855 views since Sep 7, 2008

Simple Sort

Description This code shows simple Sorting of Numbers. Source Code public class SimpleSort { public static void main(String[] args) { int[] num = { 32, 87, 3, 589, 12, 1076, ...

0 Comments. 851 views since Sep 7, 2008

Topological Sort

Description Java: This is the code implementation of Topological Sort for a Graph having Vertex A , B , C , D , E , F , G & H Source Code class Vertex { public char label; public Vertex(char lab) { ...

0 Comments. 833 views since Aug 23, 2008

Heap Creation

Description This is a code which demonstrates how a Heap is created. Source Code import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Heap { ...

0 Comments. 802 views since Aug 31, 2008

Combined Quick Sort And Insertion Sort

Description This code is a combination of Quick Sort and Insertion Sort. Source Code public class CombineQuickAndInsertionSort { private long[] data; private int len; public CombineQuickAnd ...

0 Comments. 786 views since Sep 7, 2008

Fibonacci Function

Description This is a code which is used to print a Fibonacci number corresponding to a given number. Source Code import java.awt.*; import java.awt.event.*; import javax.swing.*; public class Fibonac ...

0 Comments. 784 views since Aug 18, 2008

Insertion Sort: Objects

Description This code shows Insertion Sorting for Objects like Name. Source Code package yfrindia; public class ObjectInsertSort { private Person[] a; private int nElems; public ObjectIns ...

0 Comments. 780 views since Sep 7, 2008

Insertion Sort

Description This program takes an input of Limit & Elements of an Array from the User and using Insertion Sort sorts it out. Source Code import java.io.*; public class InsertSort { private long[] num ...

0 Comments. 757 views since Aug 31, 2008

Binary Search

Description It is a simple Binary Search example in Java. Source Code import java.lang.*; import java.io.*; public class ex7_32 { public static void main(String args[]) throws IOException { int Elem; ...

0 Comments. 750 views since Aug 19, 2008