public class Sort extends Object
| Constructor and Description |
|---|
Sort() |
| Modifier and Type | Method and Description |
|---|---|
static void |
checkPartition(int[] order,
double[] values,
double pivotValue,
int start,
int low,
int high,
int end)
Check that a partition step was done correctly.
|
static void |
reverse(double[] order,
int offset,
int length)
Reverses part of an array.
|
static void |
reverse(int[] order)
Reverses an array in-place.
|
static void |
reverse(int[] order,
int offset,
int length)
Reverses part of an array.
|
static void |
sort(double[] key,
double[]... values)
Quick sort in place of several paired arrays.
|
static void |
sort(double[] key,
int start,
int n,
double[]... values)
Quick sort using an index array.
|
static boolean |
sort(int[] order,
double[] values,
double[] weights,
int n)
Two-key quick sort on (values, weights) using an index array
|
static void |
stableSort(int[] order,
double[] values,
int n)
Single-key stabilized quick sort on using an index array
|
public static void stableSort(int[] order,
double[] values,
int n)
order - Indexes into valuesvalues - The values to sort.n - The number of values to sortpublic static boolean sort(int[] order,
double[] values,
double[] weights,
int n)
order - Indexes into valuesvalues - The values to sort.weights - The secondary sort keyn - The number of values to sortpublic static void sort(double[] key,
double[]... values)
key - Values to sort onvalues - The auxilliary values to sort.public static void sort(double[] key,
int start,
int n,
double[]... values)
key - Values to sort onstart - The first element to sortn - The number of values to sortvalues - The auxilliary values to sort.public static void checkPartition(int[] order,
double[] values,
double pivotValue,
int start,
int low,
int high,
int end)
order - The array of indexes representing a permutation of the keys.values - The keys to sort.pivotValue - The value that splits the datastart - The beginning of the data of interest.low - Values from start (inclusive) to low (exclusive) are < pivotValue.high - Values from low to high are equal to the pivot.end - Values from high to end are above the pivot.public static void reverse(int[] order)
order - The array to reversepublic static void reverse(int[] order,
int offset,
int length)
reverse(int[])order - The array containing the data to reverse.offset - Where to start reversing.length - How many elements to reversepublic static void reverse(double[] order,
int offset,
int length)
reverse(int[])order - The array containing the data to reverse.offset - Where to start reversing.length - How many elements to reverseCopyright © 2021. All rights reserved.