# (java)Balanced Binary Tree

Given a binary tree, determine if it is height-balanced.

For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of the two subtrees of every node never differ by more than 1.

public class Solution {

public boolean isBalanced(TreeNode root) {
if(root==null) return true;
if(Math.abs(depth(root.left)-depth(root.right))>1) {
return false;
}
return isBalanced(root.left)&&isBalanced(root.right);
}
public int depth(TreeNode root) {
if(root==null) return 0;
return 1+Math.max(depth(root.left), depth(root.right));
}
}

#### 平衡树——自平衡二叉树(Balanced Tree - AVL Tree)

2017-06-10 11:59:05

#### LeetCode(110)Balanced Binary Tree

2014-01-16 07:46:33

#### 【LeetCode-面试算法经典-Java实现】【110-Balanced Binary Tree（平衡二叉树）】

2015-08-11 07:34:02

#### LeetCode-Balanced Binary Tree && 二叉树的深度 && 二叉树的平衡

2014-05-20 13:16:47

#### Leetcode_110_Balanced Binary Tree

2014-12-28 21:35:16

#### 【leetCode】 Balanced Binary Tree python版实现

2016-06-18 16:56:00

#### Leetcode-标签为Tree 110. Balanced Binary Tree

2017-04-23 09:49:57

#### [Leetcode][python]Balanced Binary Tree

2017-08-03 04:10:38

#### LeetCode Convert Sorted List to Binary Search Tree 解题报告

2014-10-01 22:30:08

#### LeetCode 110. Balanced Binary Tree 递归求解

2016-02-23 16:28:36