docs: private static int partition(double[] array, int[] index, int l, int r) {
      
      double pivot = array[index[(l + r) / 2]];
      int help;
  
      while (l < r) {
        while ((array[index[l]] < pivot) && (l < r)) {
          l++;
        }
        while ((array[index[r]] > pivot) && (l < r)) {
          r--;
        }
        if (l < r) {
          help = index[l];
          index[l] = index[r];
          index[r] = help;
          l++;
          r--;
        }
      }
      if ((l == r) && (array[index[r]] > pivot)) {
        r--;
      } 
  
      return r;
    }