Class Arrays2


  • public final class Arrays2
    extends Object
    Author:
    Sergey Polovko
    • Method Detail

      • isSorted

        public static <T extends Comparable<T>> boolean isSorted​(T[] a)
        Check if array is sorted.
        Returns:
        true iff array sorted
      • sortBothByFirst

        public static <T extends Comparable<T>,​U> void sortBothByFirst​(T[] first,
                                                                             U[] second)
        In-place sort both arrays using comparability of elements of the first array.