/** * Sorts the specified range in the array in a specified order. * * @param array * the {@code char} array to be sorted. * @param start * the start index to sort. * @param end * the last + 1 index to sort. * @throws IllegalArgumentException * if {@code start > end}. * @throws ArrayIndexOutOfBoundsException * if {@code start < 0} or {@code end > array.length}. */ public static void quickSort(char[] array, int start, int end, CharComparator comp) { Preconditions.checkNotNull(array); checkBounds(array.length, start, end); quickSort0(start, end, array, comp); }
/** * Sorts the specified range in the array in a specified order. * * @param array * the {@code float} array to be sorted. * @param start * the start index to sort. * @param end * the last + 1 index to sort. * @param comp * the comparator. * @throws IllegalArgumentException * if {@code start > end}. * @throws ArrayIndexOutOfBoundsException * if {@code start < 0} or {@code end > array.length}. */ public static void quickSort(float[] array, int start, int end, FloatComparator comp) { Preconditions.checkNotNull(array); checkBounds(array.length, start, end); quickSort0(start, end, array, comp); }
/** * Sorts the specified range in the array in a specified order. * * @param array * the array to be sorted. * @param start * the start index to sort. * @param end * the last + 1 index to sort. * @param comp * the comparator. * @throws IllegalArgumentException * if {@code start > end}. * @throws ArrayIndexOutOfBoundsException * if {@code start < 0} or {@code end > array.length}. */ public static <T> void quickSort(T[] array, int start, int end, Comparator<T> comp) { Preconditions.checkNotNull(array); checkBounds(array.length, start, end); quickSort0(start, end, array, comp); }
/** * Sorts some external data with QuickSort. * * @param start * the start index to sort. * @param end * the last + 1 index to sort. * @param comp * the comparator. * @param swap an object that can exchange the positions of two items. * @throws IllegalArgumentException * if {@code start > end}. * @throws ArrayIndexOutOfBoundsException * if {@code start < 0} or {@code end > array.length}. */ public static void quickSort(int start, int end, IntComparator comp, Swapper swap) { checkBounds(end + 1, start, end); quickSort0(start, end, comp, swap); }
/** * Sorts the specified range in the array in a specified order. * * @param array * the {@code long} array to be sorted. * @param start * the start index to sort. * @param end * the last + 1 index to sort. * @param comp * the comparator. * @throws IllegalArgumentException * if {@code start > end}. * @throws ArrayIndexOutOfBoundsException * if {@code start < 0} or {@code end > array.length}. */ public static void quickSort(long[] array, int start, int end, LongComparator comp) { Preconditions.checkNotNull(array); checkBounds(array.length, start, end); quickSort0(start, end, array, comp); }
/** * Sorts the specified range in the array in a specified order. * * @param array * the {@code int} array to be sorted. * @param start * the start index to sort. * @param end * the last + 1 index to sort. * @param comp * the comparator. * @throws IllegalArgumentException * if {@code start > end}. * @throws ArrayIndexOutOfBoundsException * if {@code start < 0} or {@code end > array.length}. */ public static void quickSort(int[] array, int start, int end, IntComparator comp) { Preconditions.checkNotNull(array); checkBounds(array.length, start, end); quickSort0(start, end, array, comp); }
/** * Sorts the specified range in the array in ascending numerical order. * * @param array * the {@code short} array to be sorted. * @param start * the start index to sort. * @param end * the last + 1 index to sort. * @throws IllegalArgumentException * if {@code start > end}. * @throws ArrayIndexOutOfBoundsException * if {@code start < 0} or {@code end > array.length}. */ public static void quickSort(short[] array, int start, int end, ShortComparator comp) { Preconditions.checkNotNull(array); checkBounds(array.length, start, end); quickSort0(start, end, array, comp); }
/** * Sorts the specified range in the array in a specified order. * * @param array * the {@code double} array to be sorted. * @param start * the start index to sort. * @param end * the last + 1 index to sort. * @param comp * the comparison. * @throws IllegalArgumentException * if {@code start > end}. * @throws ArrayIndexOutOfBoundsException * if {@code start < 0} or {@code end > array.length}. * @see Double#compareTo(Double) */ public static void quickSort(double[] array, int start, int end, DoubleComparator comp) { Preconditions.checkNotNull(array); checkBounds(array.length, start, end); quickSort0(start, end, array, comp); }
/** * Sorts the specified range in the array in a specified order. * * @param array * the {@code byte} array to be sorted. * @param start * the start index to sort. * @param end * the last + 1 index to sort. * @param comp * the comparison that determines the sort. * @throws IllegalArgumentException * if {@code start > end}. * @throws ArrayIndexOutOfBoundsException * if {@code start < 0} or {@code end > array.length}. */ public static void quickSort(byte[] array, int start, int end, ByteComparator comp) { Preconditions.checkNotNull(array); checkBounds(array.length, start, end); quickSort0(start, end, array, comp); }
quickSort0(start, start + length, array, comp); quickSort0(end - length, end, array, comp);
quickSort0(start, start + length, array, comp); quickSort0(end - length, end, array, comp);
quickSort0(start, start + length, array, comp); quickSort0(end - length, end, array, comp);
quickSort0(start, start + length, array, comp); quickSort0(end - length, end, array, comp);
quickSort0(start, start + length, array, comp); quickSort0(end - length, end, array, comp);
quickSort0(start, start + length, array, comp); quickSort0(end - length, end, array, comp);
quickSort0(start, start + length, array, comp); quickSort0(end - length, end, array, comp);
quickSort0(start, start + length, array, comp); quickSort0(end - length, end, array, comp);
quickSort0(start, start + length, comp, swap); quickSort0(end - length, end, comp, swap);
/** * Sorts the specified range in the array in ascending numerical order. * * @param array * the {@code short} array to be sorted. * @param start * the start index to sort. * @param end * the last + 1 index to sort. * @throws IllegalArgumentException * if {@code start > end}. * @throws ArrayIndexOutOfBoundsException * if {@code start < 0} or {@code end > array.length}. */ public static void quickSort(short[] array, int start, int end, ShortComparator comp) { Preconditions.checkNotNull(array); checkBounds(array.length, start, end); quickSort0(start, end, array, comp); }
/** * Sorts some external data with QuickSort. * * @param start * the start index to sort. * @param end * the last + 1 index to sort. * @param comp * the comparator. * @param swap an object that can exchange the positions of two items. * @throws IllegalArgumentException * if {@code start > end}. * @throws ArrayIndexOutOfBoundsException * if {@code start < 0} or {@code end > array.length}. */ public static void quickSort(int start, int end, IntComparator comp, Swapper swap) { checkBounds(end + 1, start, end); quickSort0(start, end, comp, swap); }