| java.lang.Object net.sf.saxon.sort.QuickSort
QuickSort | abstract public class QuickSort (Code) | | This is a generic version of C.A.R Hoare's Quick Sort
algorithm. This will handle arrays that are already
sorted, and arrays with duplicate keys.
author: Patrick C. Beard (beard@netscape.com) author: Java Runtime Enthusiast -- "Will invoke interfaces for food." author: This code reached me (Michael Kay) via meteko.com; I'm assuming that it's OK author: to use because they copied it freely to me. author: Modified by MHK in May 2001 to sort any object that implements the Sortable author: interface, not only an array. |
Method Summary | |
public static void | sort(Sortable a, int lo0, int hi0) This is a generic version of C.A.R Hoare's Quick Sort
algorithm. |
sort | public static void sort(Sortable a, int lo0, int hi0)(Code) | | This is a generic version of C.A.R Hoare's Quick Sort
algorithm. This will handle arrays that are already
sorted, and arrays with duplicate keys.
If you think of a one dimensional array as going from
the lowest index on the left to the highest index on the right
then the parameters to this function are lowest index or
left and highest index or right. The first time you call
this function it will be with the parameters 0, a.length - 1.
Parameters: a - a Sortable object Parameters: lo0 - index of first element (initially typically 0) Parameters: hi0 - index of last element (initially typically length-1) |
|
|