I need a hint for this exercise from the CLRS Algorithms book:
Prove that no matter what node we start at in a height-h binary search tree, k suc
Hint: work out a small example, observe the result, try to extrapolate the reason.
To get started, here are some things to consider.
Start at a certain node, k succesive calls to Tree-Succcesor consititutes a partial tree walk. How many (at least and at most) nodes does this walk visit? (Hint: Think about key(x)). Keep in mind that an edge is visited at most twice (why?).
Final hint: The result is O(2h+k)
.