Class ArrayInPlaceMergeSorter<T>


final class ArrayInPlaceMergeSorter<T> extends InPlaceMergeSorter
An InPlaceMergeSorter for object arrays.
  • Field Details

    • arr

      private final T[] arr
    • comparator

      private final Comparator<? super T> comparator
  • Constructor Details

  • Method Details

    • 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).
      Specified by:
      compare in class Sorter
    • 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