NOTE

Quick Sort

Partition-based sorting with O(n log n) expected time, pivot selection, and worst-case safeguards.

Data Structures & AlgorithmsCreated Updated 1 min readhistorical

This is a historical learning note and may contain outdated or incomplete understanding.

Quicksort chooses a pivot, partitions elements around it, then recursively sorts the partitions.

Expected time with good/randomized pivot behavior is O(n log n), but poor pivot choices can produce O(n^2) worst-case. Practical implementations use pivot heuristics, insertion sort for tiny partitions, and/or introspective fallbacks.

Quicksort is typically in-place-ish and cache-friendly but not stable in its usual forms.

Loading helpful count