Why does QuickSort use O(log(n)) extra space?

Correct, the extra space are the log(n) stack frames. From the Wikipedia article of Quicksort: There is a more complex version which […] can achieve the complete sort using O(log n) space (not counting the input) on average (for the call stack). While you could implement quicksort iteratively (i.e., using a loop instead of recursion), … Read more