Package org.passay.dictionary.sort
Class QuickSort
java.lang.Object
org.passay.dictionary.sort.QuickSort
- All Implemented Interfaces:
ArraySorter
Provides an implementation of the quick sort algorithm.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidsort(String[] array, Comparator<CharSequence> comparator) This will sort the supplied string array.static voidsort(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.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.passay.dictionary.sort.ArraySorter
sort
-
Constructor Details
-
QuickSort
public QuickSort()
-
-
Method Details
-
sort
Description copied from interface:ArraySorterThis will sort the supplied string array.- Specified by:
sortin interfaceArraySorter- Parameters:
array- To sortcomparator- Comparator to sort with
-
sort
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
-