/** * Sorts the given array using the {@link Comparator}. This method uses the quick sort * algorithm, but falls back to insertion sort for small arrays. */ public static <T> void quickSort(T[] a, Comparator<? super T> comp) { quickSort(a, 0, a.length, comp); }
/** * Sorts the given array in natural order. This method uses the quick sort * algorithm, but falls back to insertion sort for small arrays. */ public static <T extends Comparable<? super T>> void quickSort(T[] a) { quickSort(a, 0, a.length); }