Quicksort is a divide-and-conquer sort that picks a pivot, partitions elements into those smaller and larger than it, then recursively sorts each side. Average O(n log n), worst case O(n²).
The idea
Partitioning places the pivot in its final sorted position; everything left is smaller, everything right is larger. Recurse on both sides.
