Medium

Quick Sort

Quick sort partitions around a pivot, then sorts the two sides. Balanced pivots give log n levels. A bad pivot every time gives n levels.

Costs

CategoryAlgorithm
DifficultyMedium
AverageO(n log n)
WorstO(n²)
Extra memory, typical recursionO(log n)

Questions

What is Quick Sort?

Quick sort partitions around a pivot, then sorts the two sides. Balanced pivots give log n levels. A bad pivot every time gives n levels.

Where do I practice it?

DSA Master keeps challenges and progress on the phone. This page is the idea and the costs.