I have confusion in checking weather the given Tree is Balance or not. To check the tree is balance or not we calculate the mod(difference of height of left subtree - height of right subtree at each node).
Lets take an example tree in figure. The difference of red node in the lecture at youtube is calculate as 2. They said height of left subtree is 1 and the right is -1. But what I have understand so far the height is left subtree is 2 and right subtree is 0
Asked
Active
Viewed 34 times
0

Addee
- 663
- 10
- 21
-
You are right the height of the `left subtree` is `2` and that of the `right tree` is `0`. – uSeemSurprised Apr 06 '16 at 12:52
-
I don't think what I said is correct – Addee Apr 07 '16 at 03:29