Class Sort


  • public class Sort
    extends Object
    Static sorting methods
    • Constructor Detail

      • Sort

        public Sort()
    • Method Detail

      • sort

        public static void sort​(int[] order,
                                double[] values)
        Quick sort using an index array. On return, the values[order[i]] is in order as i goes 0..values.length
        Parameters:
        order - Indexes into values
        values - The values to sort.
      • sort

        public static void sort​(int[] order,
                                double[] values,
                                int n)
        Quick sort using an index array. On return, the values[order[i]] is in order as i goes 0..values.length
        Parameters:
        order - Indexes into values
        values - The values to sort.
        n - The number of values to sort
      • checkPartition

        public static void checkPartition​(int[] order,
                                          double[] values,
                                          double pivotValue,
                                          int start,
                                          int low,
                                          int high,
                                          int end)
        Check that a partition step was done correctly. For debugging and testing.