LeetCode 110 ·
Easy
Balanced Binary Tree
Return true if the tree is height-balanced.
Try it
Step through the core mechanic. The simulator below runs the tree dp shape this problem is built on.
Walk the pattern
No dedicated step-through for this one yet. The shape is Tree DP — its pattern page has the interactive walkthrough, the reference implementation, and a five-problem progression that this problem sits inside.
The approach
DFS returns height, or a sentinel −1 once any subtree is found unbalanced. Checking balance and height in one pass beats the naive O(n²) recompute.
| Aspect | Value |
|---|---|
| Pattern | Tree DP |
| Recognise it by | Heights of siblings differ by ≤ 1 everywhere. |
| Time complexity | O(n) |
| Space complexity | O(h) |
| Difficulty | Easy |
Who asks it
Companies known to ask this problem, from public LeetCode company-tag aggregations. A signal of where to expect it, not a guarantee.