Balance and the AVL Property
The height of a node is the number of edges on the longest path from it down to a leaf, and an empty subtree has height . The balance factor of a node is the height of its left subtree minus the height of its right subtree.
Solution
10, 35, 45, 52, 75, and 90 are leaves, so each has a balance factor of . For the other nodes, 20 is , 30 is , 40 is , 55 is , 60 is , 70 is , 85 is , 80 is , and 50 is .
It is not an AVL tree. 60 has a balance factor of , and an AVL tree needs every node’s balance factor to be , , or . The root being balanced is not enough.
Solution
If only the root had to be balanced, each of its two subtrees could be a long chain. With nodes, the tree could then have height about , and search would be . The height bound holds only when every node is balanced.