/** Sorts an array according to the natural ascending order using mergesort. * * <p>This sort is guaranteed to be <i>stable</i>: equal elements will not be reordered as a result * of the sort. An array as large as <code>a</code> will be allocated by this method. * @param a the array to be sorted. */ public static void mergeSort( final boolean a[] ) { mergeSort( a, 0, a.length ); } /** Sorts the specified range of elements according to the order induced by the specified
/** * Sorts an array according to the natural ascending order using mergesort. * * <p> * This sort is guaranteed to be <i>stable</i>: equal elements will not be * reordered as a result of the sort. An array as large as {@code a} will be * allocated by this method. * * @param a * the array to be sorted. */ public static void mergeSort(final boolean a[]) { mergeSort(a, 0, a.length); } /**
/** Sorts an array according to the order induced by the specified * comparator using mergesort. * * <p>This sort is guaranteed to be <i>stable</i>: equal elements will not be reordered as a result * of the sort. An array as large as <code>a</code> will be allocated by this method. * @param a the array to be sorted. * @param comp the comparator to determine the sorting order. */ public static void mergeSort( final boolean a[], BooleanComparator comp ) { mergeSort( a, 0, a.length, comp ); } /** Shuffles the specified array fragment using the specified pseudorandom number generator.
/** * Sorts an array according to the order induced by the specified comparator * using mergesort. * * <p> * This sort is guaranteed to be <i>stable</i>: equal elements will not be * reordered as a result of the sort. An array as large as {@code a} will be * allocated by this method. * * @param a * the array to be sorted. * @param comp * the comparator to determine the sorting order. */ public static void mergeSort(final boolean a[], BooleanComparator comp) { mergeSort(a, 0, a.length, comp); } /**
/** Sorts the specified range of elements according to the natural ascending order using mergesort. * * <p>This sort is guaranteed to be <i>stable</i>: equal elements will not be reordered as a result * of the sort. An array as large as <code>a</code> will be allocated by this method. * @param a the array to be sorted. * @param from the index of the first element (inclusive) to be sorted. * @param to the index of the last element (exclusive) to be sorted. */ public static void mergeSort( final boolean a[], final int from, final int to ) { mergeSort( a, from, to, a.clone() ); } /** Sorts an array according to the natural ascending order using mergesort.
/** Sorts the specified range of elements according to the order induced by the specified * comparator using mergesort. * * <p>This sort is guaranteed to be <i>stable</i>: equal elements will not be reordered as a result * of the sort. An array as large as <code>a</code> will be allocated by this method. * * @param a the array to be sorted. * @param from the index of the first element (inclusive) to be sorted. * @param to the index of the last element (exclusive) to be sorted. * @param comp the comparator to determine the sorting order. */ public static void mergeSort( final boolean a[], final int from, final int to, BooleanComparator comp ) { mergeSort( a, from, to, comp, a.clone() ); } /** Sorts an array according to the order induced by the specified
/** * Sorts the specified range of elements according to the natural ascending * order using mergesort. * * <p> * This sort is guaranteed to be <i>stable</i>: equal elements will not be * reordered as a result of the sort. An array as large as {@code a} will be * allocated by this method. * * @param a * the array to be sorted. * @param from * the index of the first element (inclusive) to be sorted. * @param to * the index of the last element (exclusive) to be sorted. */ public static void mergeSort(final boolean a[], final int from, final int to) { mergeSort(a, from, to, a.clone()); } /**
/** * Sorts the specified range of elements according to the order induced by the * specified comparator using mergesort. * * <p> * This sort is guaranteed to be <i>stable</i>: equal elements will not be * reordered as a result of the sort. An array as large as {@code a} will be * allocated by this method. * * @param a * the array to be sorted. * @param from * the index of the first element (inclusive) to be sorted. * @param to * the index of the last element (exclusive) to be sorted. * @param comp * the comparator to determine the sorting order. */ public static void mergeSort(final boolean a[], final int from, final int to, BooleanComparator comp) { mergeSort(a, from, to, comp, a.clone()); } /**