Class QuickSort

java.lang.Object
org.passay.dictionary.sort.QuickSort
All Implemented Interfaces:
ArraySorter

public class QuickSort extends Object implements ArraySorter
Provides an implementation of the quick sort algorithm.
  • Constructor Details

    • QuickSort

      public QuickSort()
  • Method Details

    • sort

      public void sort(String[] array, Comparator<CharSequence> comparator)
      Description copied from interface: ArraySorter
      This will sort the supplied string array.
      Specified by:
      sort in interface ArraySorter
      Parameters:
      array - To sort
      comparator - Comparator to sort with
    • sort

      public static void sort(String[] array, Comparator<CharSequence> c, int lo, int hi)
      This will sort the supplied array beginning at the lo index and ending at the hi index, using the quick sort algorithm.
      Parameters:
      array - to sort
      c - comparator to sort with
      lo - index to beginning sorting at
      hi - index to stop sorting at