0110. Balanced Binary Tree
Easy | Tree + DFS | 36 ms (99.59%), 17.9 MB (88.06%)
Last updated
Was this helpful?
Easy | Tree + DFS | 36 ms (99.59%), 17.9 MB (88.06%)
Last updated
Was this helpful?
Source: GitHub:
Given a binary tree, determine if it is height-balanced.
For this problem, a height-balanced binary tree is defined as:
binary tree in which the left and right subtrees of every node differ in height by no more than 1.
Since the minimum height of a tree is 0 (the root is null), we could use '-1' to mark the node with unbalanced subtrees.