public class QuickSort extends Object
Modifier and Type | Method and Description |
---|---|
static void |
insertionSort(double[] x,
int start,
int end) |
static void |
sort(double[] x,
int start,
int end)
Performs sorting based on the double values natural comparator.
|
static void |
sort(double[] x,
int start,
int end,
Collection<List<?>> paired)
Performs sorting based on the double values natural comparator.
|
static void |
sort(float[] x,
int start,
int end,
Collection<List<?>> paired)
Performs sorting based on the double values natural comparator.
|
static void |
swap(double[] array,
int i,
int j) |
static void |
swap(double[] array,
int i,
int j,
Collection<List<?>> paired) |
static void |
swap(float[] array,
int i,
int j) |
static void |
swap(float[] array,
int i,
int j,
Collection<List<?>> paired) |
static void |
swapC(double[] array,
int i,
int j)
Conditional swap, only swaps the values if array[i] > array[j]
|
protected static void |
vecswap(double[] x,
int a,
int b,
int n) |
protected static void |
vecswap(float[] x,
int a,
int b,
int n) |
protected static void vecswap(double[] x, int a, int b, int n)
protected static void vecswap(float[] x, int a, int b, int n)
public static void swap(double[] array, int i, int j)
public static void swap(float[] array, int i, int j)
public static void swapC(double[] array, int i, int j)
array
- the array to potentially swap values ini
- the 1st indexj
- the 2nd indexpublic static void swap(double[] array, int i, int j, Collection<List<?>> paired)
array
- the array to swap values ini
- the 1st indexj
- the 2nd indexpaired
- a collection of lists, every list will have its indices swapped as wellpublic static void swap(float[] array, int i, int j, Collection<List<?>> paired)
array
- the array to swap values ini
- the 1st indexj
- the 2nd indexpaired
- a collection of lists, every list will have its indices swapped as wellpublic static void sort(double[] x, int start, int end)
Double.NaN
values will not be handled appropriately.x
- the array to sortstart
- the starting index (inclusive) to sortend
- the ending index (exclusive) to sortpublic static void insertionSort(double[] x, int start, int end)
x
- start
- inclusiveend
- exclusivepublic static void sort(double[] x, int start, int end, Collection<List<?>> paired)
Double.NaN
values will not be handled appropriately.x
- the array to sortstart
- the starting index (inclusive) to sortend
- the ending index (exclusive) to sortpaired
- a collection of lists, every list will have its indices swapped as wellpublic static void sort(float[] x, int start, int end, Collection<List<?>> paired)
Double.NaN
values will not be handled appropriately.x
- the array to sortstart
- the starting index (inclusive) to sortend
- the ending index (exclusive) to sortpaired
- a collection of lists, every list will have its indices swapped as wellCopyright © 2017. All rights reserved.