6 votes 6 votes Mark the balance factor of each node on the tree given in the below figure and state whether it is height-balanced. DS gate1988 data-structures normal descriptive avl-tree binary-tree + – go_editor asked Dec 19, 2016 • edited Dec 17, 2023 by Arjun go_editor 2.1k views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
Best answer 11 votes 11 votes Balancing factor $ = $ the height of left subtree $-$ the height of right subtree Balancing factors of all the nodes are marked in the figure. Since there is no node that has a balancing factor greater than $1,$ we can say that the tree is balanced. Akash Papnai answered Nov 5, 2019 • edited Dec 16, 2021 by Arjun Akash Papnai comment Share Follow See all 2 Comments See all 2 2 Comments reply Kiyoshi commented Apr 25, 2021 reply Follow Share @Akash Papnai On the node 12 in the tree the balance factor would be 0 and not 1. please correct it.!!! 13 votes 13 votes Sunil kumar sam commented Oct 31, 2022 reply Follow Share please correct it..the balance factor of 12 is 0 not 1. 1 votes 1 votes Please log in or register to add a comment.
5 votes 5 votes 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. Gurdeep Saini answered Nov 26, 2018 • edited Jun 16, 2019 by Lakshman Bhaiya Gurdeep Saini comment Share Follow See all 0 reply Please log in or register to add a comment.