Package org.passay.dictionary.sort
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.- Author:
- Middleware Services
-
-
Constructor Summary
Constructors Constructor Description QuickSort()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
sort(String[] array, Comparator<String> c)
This will sort the supplied string array.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.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.passay.dictionary.sort.ArraySorter
sort
-
-
-
-
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 interfaceArraySorter
- Parameters:
array
- To sortc
- 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 sortc
- comparator to sort withlo
- index to beginning sorting athi
- index to stop sorting at
-
-