Class QuickSort
- java.lang.Object
-
- org.apache.flink.runtime.operators.sort.QuickSort
-
- All Implemented Interfaces:
IndexedSorter
public final class QuickSort extends Object implements IndexedSorter
-
-
Constructor Summary
Constructors Constructor Description QuickSort()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static intgetMaxDepth(int x)Deepest recursion before giving up and doing a heapsort.voidsort(IndexedSortable s)voidsort(IndexedSortable s, int p, int r)Sort the given range of items using quick sort.
-
-
-
Method Detail
-
getMaxDepth
protected static int getMaxDepth(int x)
Deepest recursion before giving up and doing a heapsort. Returns 2 * ceil(log(n)).
-
sort
public void sort(IndexedSortable s, int p, int r)
Sort the given range of items using quick sort. Sort the items accessed through the given IndexedSortable over the given range of logical indices. From the perspective of the sort algorithm, each index between l (inclusive) and r (exclusive) is an addressable entry. If the recursion depth falls belowgetMaxDepth(int), then switch toHeapSort.- Specified by:
sortin interfaceIndexedSorter- See Also:
IndexedSortable.compare(int, int),IndexedSortable.swap(int, int)
-
sort
public void sort(IndexedSortable s)
- Specified by:
sortin interfaceIndexedSorter
-
-