Files
grokking-algorithms/chapter_04
onyx-and-iris 4cd7bb7d18 reorganise directories
upd chapter_01/binary.py
2025-03-26 01:27:35 +00:00
..
2025-03-26 01:27:35 +00:00
2025-03-26 01:27:35 +00:00
2025-03-26 01:27:35 +00:00
2025-03-26 01:27:35 +00:00
2025-03-26 01:27:35 +00:00

Quicksort

Similar to the previous recursive function, quicksort uses divide and conquer.

The base case occurs for an array size 0 or 1 (doesn't need to be sorted).

The recursive case works by partitioning the array around a chosen pivot repeatedly until the base case is met and then combining all sorted sub-arrays.

Note. Quicksort should be implemented using a random pivot to ensure average runtimes.