Class InsertionSorter

java.lang.Object
dsa.lab04.solutions.InsertionSorter
All Implemented Interfaces:
Sorter

public class InsertionSorter extends Object implements Sorter
Insertion sort.
  • Constructor Details

    • InsertionSorter

      public InsertionSorter()
  • Method Details

    • sort

      public <Item> void sort(StaticSequence<Item> items, Comparator<Item> comparator)
      Description copied from interface: Sorter
      Sorts the given sequence according to the given comparator.
      Specified by:
      sort in interface Sorter
      Type Parameters:
      Item - the item type
      Parameters:
      items - the items to sort
      comparator - how to compare the items