| Modifier and Type | Field and Description |
|---|---|
| private static final int | MIN_SELECT_SIZE
Minimum selection size for insertion sort rather than selection. |
| private final PivotingStrategyInterface | pivotingStrategy
A |
| private static final long | serialVersionUID
Serializable UID. |
| Access | Constructor and Description |
|---|---|
| public | |
| public | KthSelector(final PivotingStrategyInterface
pivoting strategy to use pivotingStrategy)Constructor with specified pivoting strategy |
| Modifier and Type | Method and Description |
|---|---|
| public PivotingStrategyInterface | |
| private int | Returns: index of the pivot after partitionwork array work, final int index of the first element of the slice of work array begin, final int index after the last element of the slice of work array end, final int initial index of the pivot pivot)Partition an array slice around a pivot.Partitioning exchanges array elements such that all elements smaller than pivot are before it and all elements larger than pivot are after it. |
| public double | Returns: Kth valuework array to use to find out the Kth value work, final int[] cached pivots heap that can be used for efficient estimation pivotsHeap, final int the index whose value in the array is of interest k)Select Kth value in the array. |
| MIN_SELECT_SIZE | back to summary |
|---|---|
| private static final int MIN_SELECT_SIZE Minimum selection size for insertion sort rather than selection. | |
| pivotingStrategy | back to summary |
|---|---|
| private final PivotingStrategyInterface pivotingStrategy A | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Serializable UID. | |
| KthSelector | back to summary |
|---|---|
| public KthSelector() Constructor with default | |
| KthSelector | back to summary |
|---|---|
| public KthSelector(final PivotingStrategyInterface pivotingStrategy) throws NullArgumentException Constructor with specified pivoting strategy
| |
| getPivotingStrategy | back to summary |
|---|---|
| public PivotingStrategyInterface getPivotingStrategy() Get the pivotin strategy.
| |
| partition | back to summary |
|---|---|
| private int partition(final double[] work, final int begin, final int end, final int pivot) Partition an array slice around a pivot.Partitioning exchanges array elements such that all elements smaller than pivot are before it and all elements larger than pivot are after it.
| |
| select | back to summary |
|---|---|
| public double select(final double[] work, final int[] pivotsHeap, final int k) Select Kth value in the array.
| |