final class ArrayInPlaceMergeSorter<T> extends InPlaceMergeSorter
InPlaceMergeSorter for object arrays.| Modifier and Type | Field and Description |
|---|---|
private T[] |
arr |
private java.util.Comparator<? super T> |
comparator |
BINARY_SORT_THRESHOLD| Constructor and Description |
|---|
ArrayInPlaceMergeSorter(T[] arr,
java.util.Comparator<? super T> comparator)
Create a new
ArrayInPlaceMergeSorter. |
| Modifier and Type | Method and Description |
|---|---|
protected int |
compare(int i,
int j)
Compare entries found in slots
i and j. |
protected void |
swap(int i,
int j)
Swap values at slots
i and j. |
mergeSort, sortbinarySort, binarySort, checkRange, comparePivot, doRotate, heapChild, heapify, heapParent, heapSort, lower, lower2, mergeInPlace, reverse, rotate, setPivot, siftDown, upper, upper2private final T[] arr
private final java.util.Comparator<? super T> comparator
public ArrayInPlaceMergeSorter(T[] arr, java.util.Comparator<? super T> comparator)
ArrayInPlaceMergeSorter.protected int compare(int i,
int j)
Sorteri and j.
The contract for the returned value is the same as
Comparator.compare(Object, Object).