public class Quicksort
extends java.lang.Object
This class implements the Quicksort algorithm. It lets to sort an array of values from the lowest to the highest value and vice versa based on an option
Modifier and Type | Field and Description |
---|---|
static int |
HIGHEST_FIRST
Configuration tag (HIGHEST_FIRST).
|
static int |
LOWEST_FIRST
Configuration tag (LOWEST_FIRST).
|
Constructor and Description |
---|
Quicksort() |
Modifier and Type | Method and Description |
---|---|
static int[] |
sort(double[] vector,
int size,
int opt)
It sorts the values array based on opt
|
static void |
sortValues(keel.Algorithms.Preprocess.NoiseFilters.INFFC.Quicksort.OrderStructure[] values,
int begin,
int end)
It sorts the values between the begin and the end indexes
|
public static final int LOWEST_FIRST
public static final int HIGHEST_FIRST
public static int[] sort(double[] vector, int size, int opt)
It sorts the values array based on opt
vector
- array of double values to sortsize
- number of elements to sortopt
- equals to HIGHEST_FIRST to sort from highest to lowest, and equals to LOWEST_FIRST to
sort from lowest to highestpublic static void sortValues(keel.Algorithms.Preprocess.NoiseFilters.INFFC.Quicksort.OrderStructure[] values, int begin, int end)
It sorts the values between the begin and the end indexes
values
- values to sort with their original positionsbegin
- start position to sortend
- end position to sort