by loeg · 10y ago · 0 comments
The space requirement for depth-first search of a non-balanced binary tree is pretty clearly O(N), not O(log N). (Consider the "linked list" tree.)
For balanced trees, O(log N) is correct. This is because space required for depth-first search is identical to maximum tree depth. And balanced trees bound depth at O(log N), while non-balanced trees can be O(N) deep.
While the article leaves out the mention of the term balanced, the described "perfect" trees happen to be balanced.