Try This 6-3 The Quicksort
In Chapter 5 you were shown a simple sorting method called the Bubble sort.
It was mentioned at the time that substantially better sorts exist. Here you will develop a version of one of the best: the Quicksort. The Quicksort, invented and named by C.A.R. Hoare, is the best general-purpose sorting algorithm currently available. The reason it could not be shown in Chapter 5 is that the best implementations of the Quicksort rely on recursion. The version we will develop sorts a character array, but the logic can be adapted to sort any type of object you like.
The Quicksort is built on the idea of partitions. The general procedure is to select a value, called the comparand, and then to partition the array into ...