Quicksort
Quicksort is an efficient O(n*log(n) method for sorting.
Also a classic example of divide-and-conquer problem solving.
Basic idea is as follows:
- choose an element
x to be pivot
- rearrange sequence so that:
- all elements less than pivot are at left
- all elements greater than pivot are at right
- sort left part, sort right part (recursive)
Index