@@ -0,0 +1,826 @@
+/**%0A * Given a binary tree, determine if it is height-balanced.%0A * For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of the two %0A * subtrees of every node never differ by more than 1.%0A */%0A/**%0A * Definition for a binary tree node.%0A * public class TreeNode %7B%0A *     int val;%0A *     TreeNode left;%0A *     TreeNode right;%0A *     TreeNode(int x) %7B val = x; %7D%0A * %7D%0A */%0Apublic class Solution %7B%0A    public boolean isBalanced(TreeNode root) %7B%0A        return helper(root) %3E= 0;%0A    %7D%0A    %0A    //get the height of n%0A    private int helper(TreeNode n) %7B%0A        if(n == null) return 0;%0A        int hleft = helper(n.left);%0A        int hright = helper(n.right);%0A        if(hleft == -1 %7C%7C hright == -1 %7C%7C Math.abs(hleft - hright) %3E 1) return -1;%0A        return Math.max(hleft, hright)+1;%0A    %7D%0A%7D%0A

Create 110.java