Question: This homework problem continues our exploration of recursive functions on binary trees. For this problem youll determine whether a binary tree is height balanced .
This homework problem continues our exploration of recursive functions on binary trees. For this problem youll determine whether a binary tree is height balanced. A tree is height balanced if height of two subtrees an every node never differ by more than one.


For example, this tree is height balanced: 4 The height of 3's two subtrees are O and 1, which do not differ by more than one. The heights of 11's two subtrees are 1 and 2, which do not differ by more than one. And the heights of 5's two subtrees are 0 and 0, which do not differ by more than one. This tree is not height balanced: 4 This is because 11 has one subtree of height 3 and a second of height 1 For example, this tree is height balanced: 4 The height of 3's two subtrees are O and 1, which do not differ by more than one. The heights of 11's two subtrees are 1 and 2, which do not differ by more than one. And the heights of 5's two subtrees are 0 and 0, which do not differ by more than one. This tree is not height balanced: 4 This is because 11 has one subtree of height 3 and a second of height 1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
