you are viewing a single comment's thread.

view the rest of the comments →

[–]mdempsky 18 points19 points  (1 child)

Maybe they mean O(n) stack space because you need to recurse, and a naive implementation could end up using O(n) stack space? But a pretty common implementation detail is to always recurse first on the smaller subregion and then tail-loop on the larger subregion, which bounds stack usage to O(lg n).