docs: private int partition(double[] a, int[] indexes, int left, int right) {
          int i = left - 1;
          int j = right;
          while (true) {
              while (a[indexes[++i]] < a[indexes[right]]); // find item on left to swap, a[right] acts as sentinel
              while (a[indexes[right]] < a[indexes[--j]]) { // find item on right to swap
                  if (j == left)
                      break; // don't go out-of-bounds
              }
              if (i >= j)
                  break; // check if pointers cross
              swap(a, indexes, i, j); // swap two elements into place
          }
          swap(a, indexes, i, right); // swap with partition element
          return i;
      }