Quicksort: The Big Picture!

  • Explain and trace the quicksort algorithm on a particular data sequence.

In Quicksort, we partition the sequence into two subsequences separated by a single element xx that is greater than or equal to every element in the left subsequence and less than or equal to every element in the right subsequence.

After partitioning, the element xx, called the pivot element, is in its final (sorted) position.

We now apply the partitioning to the two subsequences separately. This process is naturally recursive (and quick).

Demo
Resources