Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Inorder-Tree-Walk(x) - time T(n)
- 1. if(x != nil) - time C1
- 2. then Inorder-Tree-Walk(left[x]) - time T(k)
- 3. print key[x] - time C2
- 4. Inorder-Tree-Walk(right[x]) - time T(n-k-1)
- T(n) = C1 + C2 + T(k) + T(n-k-1)
Add Comment
Please, Sign In to add comment