Quicksort: The Big Picture!

In Quicksort, we partition the sequence into two subsequences separated by a single element $x$ 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 $x$, called the pivot element, is in its final (sorted) position.

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

Demo
Resources