균형 이진 탐색 트리1 [LEET CODE] 110. Balanced Binary Tree # Problem Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary tree is defined as: Constraints: The number of nodes in the tree is in the range [0, 5000]. -104 1: return False return a and b # 서브 트리도 모두 균형인지 확인 # Solution 1 - 재귀 구조로 높이 차이 계산 class Solution: def isBalanced(self, root: TreeNode) -> bool: def check(root): if not root: return 0 left = c.. 2021. 4. 20. 이전 1 다음 반응형