Quick Sort
A very quick way to sort a set of data is to use the quicksort algorithm.
The algorithm performs the following functions on a set of data:
Quick Sort Algorithm
It selects one of the pieces of data in the set of data to be sorted, called the ‘PIVOT’.
It makes a pass through all the data items. At the end of the pass, three things will have happened:
1. The PIVOT will be positioned correctly.
2. Data items less than the PIVOT will be on the left of it.
3. Data items greater than the PIVOT will be on the right of it.
The quicksort algorithm is then applied recursively to the left of the PIVOT.
The quicksort algorithm is then applied recursively to the right of the PIVOT.