Class QuickSorter
- public class QuickSorter
- extends ASorter
Sorts by first splitting the array into two subarrays: one is less or equal to the
first element of the original array, the other is greater or equal to the same
first element. Then recursively sorts the subarrays to make the original array sorted.
This algorithm is due to Tony Hoare. In Merritt's sorting taxonomy, this algorithm
belongs to the family of sorting where the splitting is hard and the joining is easy.
- Author:
- Dung X. Nguyen - Copyright 1999 - All rights reserved.

Singleton

QuickSorter
()

join
(int[], int, int, int)
main
(String[])
split
(int[], int, int)
- Splits A[lo:hi] in such a way that A[lo:s-1] <= A[s:hi] for some s

Singleton
public static final QuickSorter Singleton

QuickSorter
private QuickSorter()

split
public int split(int[] A, int lo, int hi)
- Splits A[lo:hi] in such a way that A[lo:s-1] <= A[s:hi] for some s.
- Parameters:
- A -
- lo - < hi.
- hi - > lo.
- Returns:
- s such that A[lo:s-1] <= A[s:hi]
join
public void join(int[] A, int lo, int s, int hi)
- Parameters:
- A - A[lo:s-1] and A[s:hi] are sorted, and A[lo:s-1] <= A[s:hi].
- lo -
- s - in [lo:hi].
- hi -
main
public static void main(String[] args)