Problem
Describe a nonrecursive, in-place version of the quick-sort algorithm. The algorithm should still be based on the same divide-and-conquer approach, but use an explicit stack to process subproblems. Your algorithm should also guarantee the stack depth is at most O(logn).