+1 vote
290 views

Mark the balance factor of each on the tree given on the below figure and state whether it is height-balanced.

in DS
edited | 290 views

Balance Factor $=$ height $($left Sub Tree$)−$ height $($right Sub Tree$)$

for height balance tree, balance factor of every node  should be from $-1 \ to \ 1 \ \ i.e. (-1,0,1)$

So, given tree is height balanced tree.

edited
+1 vote

Balancing factor: | height of left subtree - height of right subtree |.

I have marked the balancing factors of all nodes.

Since there is no node that has balancing factor as >=2. Hence, we can say that the tree is balanced.