Class KthSelector


  • public class KthSelector
    extends java.lang.Object
    • Constructor Detail

      • KthSelector

        public KthSelector()
        Constructor with default median of 3 pivoting strategy
    • Method Detail

      • getPivotingStrategy

        public PivotingStrategyInterface getPivotingStrategy()
        Get the pivotin strategy.
        Returns:
        pivoting strategy
      • select

        public double select​(double[] work,
                             int[] pivotsHeap,
                             int k)
        Select Kth value in the array.
        Parameters:
        work - work array to use to find out the Kth value
        pivotsHeap - cached pivots heap that can be used for efficient estimation
        k - the index whose value in the array is of interest
        Returns:
        Kth value