Lines Matching defs:right
44 // quicksort a[left] to a[right]
45 public void quicksort(Type[] a, int left, int right, Comparator<Type> comparator) {
46 if (right <= left) return;
47 int i = partition(a, left, right, comparator);
49 quicksort(a, i + 1, right, comparator);
52 // partition a[left] to a[right], assumes left < right
53 private int partition(Type[] a, int left, int right, Comparator<Type> comparator) {
55 int j = right;
57 while (comparator.compare(a[++i], a[right]) < 0) { // find item on left to swap
58 } // a[right] acts as sentinel
59 while (comparator.compare(a[right], a[--j]) < 0) { // find item on right to swap
72 a[i] = a[right];
73 a[right] = swap;