A recursive, divide-and-conquer sorting algorithm.

Visualisation

Source Source

Efficiency

Worst-case performance: Best-case performance:

Implementation


Time analysis

There are 2 branches per call of quick sort.

Worst case: pivot is at the very left or very right

Best case, pivot is in exact middle