Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- size(L) = 10 height(L) = 7
- size(R) = 5 height(R) = 5
- Maximum height is 2 * floor(log2(size)) + 1
- size(L) + size(R) = 15, max height is 7
- L R
- 1 o x o
- ╱ ╲ ╱ ╱ ╲
- 2 o o x o o
- ╱ ╲ ╱ ╱ ╱ ╲ ╱ ╲
- 3 o o o + x = o o o x
- ╱ ╲ ╱ ╱
- 4 o x o x
- ╱ ╱ ╱ ╱
- 5 o x o x
- ╱ ╱ ╲
- 6 o o x
- ╲ ╲ ╱
- 7 o o x
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement