/** * Sorts the given array using the {@link Comparator}. This method uses the merge sort * algorithm, but falls back to insertion sort for small arrays. */ public static <T> void mergeSort(T[] a, Comparator<? super T> comp) { mergeSort(a, 0, a.length, comp); }
/** * Sorts the given array in natural order. This method uses the merge sort * algorithm, but falls back to insertion sort for small arrays. */ public static <T extends Comparable<? super T>> void mergeSort(T[] a) { mergeSort(a, 0, a.length); }
ArrayUtil.mergeSort(scorers, new Comparator<NodeScorer>() { // sort the array public int compare(final NodeScorer o1, final NodeScorer o2) { return o1.doc() - o2.doc();
ArrayUtil.mergeSort(scoreTerms, scoreTermSortByTermComp);