I don’t understand quite why the example of the whether the binary tree is balanced is actually unbalanced.
The left subtree root is 2. At this level, the HLT is 2. And the right subtree root is 3 and at this level the HRT is 2. So at the root node, which is 1, the HLT and HRT are 3 and 3 each. By the definition the difference of HLT - HRT is 0 and hence it should be balanced. So, why is the answer unbalanced ?
Course: Data Structures for Coding Interviews in Java - Learn Interactively
Lesson: What Makes a Tree Balanced? - Data Structures for Coding Interviews in Java