Class QuickSort
java.lang.Object
gov.nih.mipav.view.renderer.WildMagic.Poisson.Octree.QuickSort
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidThis is a generic version of C.A.R Hoare's Quick Sort algorithm.voidqsort(Object[] v, int left, int right, Comparator comp) voidvoidprivate static void
-
Field Details
-
mComparator
-
-
Constructor Details
-
QuickSort
-
-
Method Details
-
qsort
-
qsort
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- an Object arraylo0- left boundary of array partitionhi0- right boundary of array partition
-
swap
-
sort
-
sort
-