Class QuickSort

  • All Implemented Interfaces:
    ArraySorter

    public class QuickSort
    extends Object
    implements ArraySorter
    Provides an implementation of the quick sort algorithm.
    Author:
    Middleware Services
    • Constructor Detail

      • QuickSort

        public QuickSort()
    • Method Detail

      • sort

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

        public static void sort​(String[] array,
                                Comparator<String> 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