Sort algorithms home |
Java | C | FORTRAN | PASCAL
sort simple sort In-place sort quicksort balanced quicksort introspective sort insertion sort selection sort diminishing increment sort shell sort heapsort adaptive heap sort introspective sort adaptive sort adaptive heap sort distribution sort bin sort range sort counting sort histogram sort merge sort |
quicksort
Inherits from In-place sort
An in-place sort algorithm that uses the divide and conquer paradigm. It picks an element from the array (the pivot), partitions the remaining elements into those greater than and less than this pivot, and recursively sorts the partitions. There are many variants of the basic scheme above: to select the pivot, to partition the array, to stop the recursion on small partitions, etc. [National Institute of Standards and Technology]
Demonstrations: | http://www.cosc.canterbury.ac.nz/people/mukundan/dsal/QSort.html
Implementations and sample code: | http://www.cs.ubc.ca/spider/harrison/Java/QSortAlgorithm.java [Java] http://www.cs.princeton.edu/%7Ers/talks/QuicksortIsOptimal.pdf [C]
See also quicksort variants: balanced quicksort, introspective sort