Class FastQSort

  • All Implemented Interfaces:
    ComparisonSortAlgorithm<Object>, SortAlgorithm<Object>

    public final class FastQSort
    extends Object
    A quick sort demonstration algorithm SortAlgorithm.java
    Version:
    \@(#)QSortAlgorithm.java 1.3, 29 Feb 1996 extended with TriMedian and InsertionSort by Denis Ahrens with all the tips from Robert Sedgewick (Algorithms in C++). It uses TriMedian and InsertionSort for lists shorts than 4. <fuhrmann@cs.tu-berlin.de>

    Adapted from Denis Ahrens' FastQSortAlgorithm, which was derived from Sun's example QSortAlgorithm.

    2003-11-06 - Dan Armstrong - To avoid worst-case scenarios, if the quickSort recursion depth exceeds (int)(10*Math.log(list.size())), the algorithm will quit and a HeapSort will be performed.

    Author:
    James Gosling, Kevin A. Smith