Class ArrayIntroSorter<T>

    • Field Detail

      • arr

        private final T[] arr
      • comparator

        private final java.util.Comparator<? super T> comparator
      • pivot

        private T pivot
    • Constructor Detail

      • ArrayIntroSorter

        public ArrayIntroSorter​(T[] arr,
                                java.util.Comparator<? super T> comparator)
    • Method Detail

      • compare

        protected int compare​(int i,
                              int j)
        Description copied from class: Sorter
        Compare entries found in slots i and j. The contract for the returned value is the same as Comparator.compare(Object, Object).
        Overrides:
        compare in class IntroSorter
      • swap

        protected void swap​(int i,
                            int j)
        Description copied from class: Sorter
        Swap values at slots i and j.
        Specified by:
        swap in class Sorter