Friday, October 23, 2015

Quicksort in log space

This is a classic.

Can you implement simple quicksort: with the first element as the pivot, to in-place sort an array of size $n$, so that the implementation uses $O(\log n)$ space in the worst case?  If you use recursion, the stack depth is also counted.

[Assume WORD RAM model].

[Solution]

No comments:

Post a Comment