All Packages Class Hierarchy This Package Previous Next Index
Object | +----com.symantec.itools.vcafe.sort.QuickSort
Non-recursive implementation requires O(n*log(n)) comparisons for most data. That is, for 100 elements approx 650 comparisons instead of 10,000. Tested with reverse sorted, already sorted, random and constant data.
QuickSort.sort(SortableArray a);
A SortableArray must implement the SortableArray interface, i.e., define a getArray() method that returns an Object[] and a lessThan() method that compares two objects, e.g., a.lessThan(r,s) returns true iff r < s. You do not have to modify the arrays or the object classes in any way, you just have to know how to order the objects.
QuickSort cannot sort arrays of primitive types (unless they are encapsulated in objects).
public QuickSort()
public static void sort(SortableArray a)
All Packages Class Hierarchy This Package Previous Next Index