public class KthSelector extends Object implements Serializable
Constructor and Description |
---|
KthSelector()
Constructor with default
median of 3
pivoting strategy. |
KthSelector(PivotingStrategy pivotingStrategy)
Constructor with specified pivoting strategy
|
Modifier and Type | Method and Description |
---|---|
PivotingStrategy |
getPivotingStrategy()
Get the pivoting strategy.
|
double |
select(double[] work,
int[] pivotsHeap,
int k)
Select Kth value in the array.
|
public KthSelector()
median of 3
pivoting strategy.public KthSelector(PivotingStrategy pivotingStrategy) throws NullArgumentException
pivotingStrategy
- pivoting strategy to useNullArgumentException
- when pivotingStrategy is nullpublic PivotingStrategy getPivotingStrategy()
public double select(double[] work, int[] pivotsHeap, int k)
work
- work array to use to find out the Kth valuepivotsHeap
- cached pivots heap that can be used for efficient estimationk
- the index whose value in the array is of interestCopyright © 2016-2021 CS GROUP. All rights reserved.