|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jdsl.core.algo.sorts.ArrayQuickSort
Performs an in-place quicksort in expected O(n log n) time, provided that the atRank(int) method of the Sequence operates in O(1) time. The worst-case sort time is O(n-squared). The partition element is deterministically chosen to be the first element of the subsequence being sorted.
Constructor Summary | |
ArrayQuickSort()
|
Method Summary | |
void |
sort(Sequence S,
Comparator c)
Method that actually sorts the sequence, with the first element after the sort being the one that the comparator reported was smallest. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ArrayQuickSort()
Method Detail |
public void sort(Sequence S, Comparator c)
SortObject
sort
in interface SortObject
jdsl.core.algo.sorts.SortObject
s
- sequence to be sortedc
- comparator which defines in which order S is sorted
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |