Package org.h2.dev.sort
Class InPlaceStableQuicksort<T>
java.lang.Object
org.h2.dev.sort.InPlaceStableQuicksort<T>
- Type Parameters:
T- the element type
A stable quicksort implementation that uses O(log(n)) memory. It normally
runs in O(n*log(n)*log(n)), but at most in O(n^2).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> voidsort(T[] data, Comparator<T> comp) Sort an array using the given comparator.voidsortArray(T[] d, Comparator<T> c) Sort an array using the given comparator.
-
Constructor Details
-
InPlaceStableQuicksort
public InPlaceStableQuicksort()
-
-
Method Details
-
sort
Sort an array using the given comparator.- Parameters:
data- the data array to sortcomp- the comparator
-
sortArray
Sort an array using the given comparator.- Parameters:
d- the data array to sortc- the comparator
-