FileDocCategorySizeDatePackage
StrSort1_1.javaAPI DocExample882Sat Nov 25 12:56:24 GMT 2000None

StrSort1_1

public class StrSort1_1 extends Object
StrSort demonstrates sorting of strings using a quicksort. The actual sort is borrowed from the Java Demo Applet SortDemo, whose copyright allows its use. This may be useful on JDK1.1 (or even 1.0); on Java 2/JDK1.2, use Arrays.sort() or Collections.sort() instead!

Fields Summary
public static String[]
a
The list of strings to be sorted
Constructors Summary
Methods Summary
static voiddump(java.lang.String[] a, java.lang.String title)

		System.out.println("***** " + title + " *****");
		for (int i=0; i<a.length; i++)
			System.out.println("a["+i+"]="+a[i]);
	
public static voidmain(java.lang.String[] argv)
Simple main program to test the sorting


	        
	     
		System.out.println("StrSort Demo in Java");
		StringSort s = new StringSort();
		dump(a, "Before");
		s.QuickSort(a, 0, a.length-1);
		dump(a, "After");