(int[] array, int i, int pivotFrom, int pivotTo)
| 290 | // (pivotFrom, pivotTo), where the first component of the pair (lo) is |
| 291 | // ordered naturally and the second component (hi) is in reverse order. |
| 292 | private static int cmp(int[] array, int i, int pivotFrom, int pivotTo) { |
| 293 | int cmp = array[i] - pivotFrom; |
| 294 | return cmp != 0 ? cmp : pivotTo - array[i + 1]; |
| 295 | } |
| 296 | |
| 297 | // qsortIntPair() quicksorts pairs of ints in |array| according to lt(). |
| 298 | // Precondition: |left|, |right|, |this.len| must all be even; |this.len > 1|. |