docs: protected void reverse() {
      for(int i = 0, j = size - 1; i < j; i++, j--) {
        double tmpd = dists[j];
        dists[j] = dists[i];
        dists[i] = tmpd;
        int tmpi = ids[j];
        ids[j] = ids[i];
        ids[i] = tmpi;
      }
    }