class DoubleIntegerArrayQuickSort extends Object
Modifier and Type | Field and Description |
---|---|
private static int |
INSERTION_THRESHOLD
Threshold for using insertion sort.
|
Constructor and Description |
---|
DoubleIntegerArrayQuickSort() |
Modifier and Type | Method and Description |
---|---|
private static void |
quickSort(double[] keys,
int[] vals,
int start,
int end)
Actual recursive sort function.
|
static void |
sort(double[] keys,
int[] values,
int len)
Sort the full array using the given comparator.
|
static void |
sort(double[] keys,
int[] values,
int start,
int end)
Sort the array using the given comparator.
|
private static void |
swap(double[] keys,
int[] vals,
int j,
int i)
Swap two entries.
|
private static final int INSERTION_THRESHOLD
public static void sort(double[] keys, int[] values, int len)
keys
- Keys for sortingvalues
- Values for sortinglen
- Length to sort.public static void sort(double[] keys, int[] values, int start, int end)
keys
- Keys for sortingvalues
- Values for sortingstart
- First indexend
- Last index (exclusive)private static void quickSort(double[] keys, int[] vals, int start, int end)
keys
- Keys for sortingvals
- Values for sortingstart
- First indexend
- Last index (exclusive!)private static void swap(double[] keys, int[] vals, int j, int i)
keys
- Keysvals
- Valuesj
- First indexi
- Second index