Quicksort Without a Stack
暂无分享,去创建一个
The standard Quicksort algorithm requires a stack of size O(log2n) to sort a set of n elements. We introduce a simple nonrecursive version of Quicksort, which requires only a constant, O(1) additional space because the unsorted subsets are searched instead of stacking their boundaries as in the standard Quicksort. Our O(1)-space Quicksort is probably the most efficient of all the sorting algorithms which need a constant workspace only.
[1] Robert Sedgewick,et al. Implementing Quicksort programs , 1978, CACM.
[2] Donald Ervin Knuth,et al. The Art of Computer Programming , 1968 .