Interface Sorter

All Known Implementing Classes:
HeapSorter, HeapSorter, InsertionSorter, InsertionSorter, MergeSorter, MergeSorter, SelectionSorter, SelectionSorter

public interface Sorter
A sorting algorithm.
  • Method Summary

    Modifier and Type
    Method
    Description
    default <Item extends Comparable<Item>>
    void
    sort(StaticSequence<Item> items)
    Sorts the given sequence.
    <Item> void
    sort(StaticSequence<Item> items, Comparator<Item> comparator)
    Sorts the given sequence according to the given comparator.
  • Method Details

    • sort

      <Item> void sort(StaticSequence<Item> items, Comparator<Item> comparator)
      Sorts the given sequence according to the given comparator.
      Type Parameters:
      Item - the item type
      Parameters:
      items - the items to sort
      comparator - how to compare the items
    • sort

      default <Item extends Comparable<Item>> void sort(StaticSequence<Item> items)
      Sorts the given sequence.
      Type Parameters:
      Item - the item type
      Parameters:
      items - the items to sort