Class MedianOf3PivotingStrategy

    • Method Detail

      • pivotIndex

        public int pivotIndex​(double[] work,
                              int begin,
                              int end)
        Find pivot index of the array so that partition and Kth element selection can be made. This in specific makes use of median of 3 pivoting.
        Specified by:
        pivotIndex in interface PivotingStrategy
        work - data array
        begin - index of the first element of the slice
        end - index after the last element of the slice
        The index corresponding to a pivot chosen between the first, middle and the last indices of the array slice
        MathIllegalArgumentException - MathIllegalArgumentException when indices exceeds range