Lines Matching refs:hi
176 static <T> void sort(T[] a, int lo, int hi, Comparator<? super T> c) {
178 Arrays.sort(a, lo, hi);
182 rangeCheck(a.length, lo, hi);
183 int nRemaining = hi - lo;
189 int initRunLen = countRunAndMakeAscending(a, lo, hi, c);
190 binarySort(a, lo, hi, lo + initRunLen, c);
203 int runLen = countRunAndMakeAscending(a, lo, hi, c);
222 assert lo == hi;
240 * @param hi the index after the last element in the range to be sorted
242 * not already known to be sorted ({@code lo <= start <= hi})
246 private static <T> void binarySort(T[] a, int lo, int hi, int start,
248 assert lo <= start && start <= hi;
251 for ( ; start < hi; start++) {
310 * @param hi index after the last element that may be contained in the run.
311 It is required that {@code lo < hi}.
316 private static <T> int countRunAndMakeAscending(T[] a, int lo, int hi,
318 assert lo < hi;
320 if (runHi == hi)
325 while (runHi < hi && c.compare(a[runHi], a[runHi - 1]) < 0)
329 while (runHi < hi && c.compare(a[runHi], a[runHi - 1]) >= 0)
341 * @param hi the index after the last element in the range to be reversed
343 private static void reverseRange(Object[] a, int lo, int hi) {
344 hi--;
345 while (lo < hi) {
347 a[lo++] = a[hi];
348 a[hi--] = t;