public static boolean isBalance(TreeNode root,ArrayList<Integer> depth){
		if(root == null){
			return true;
		}
		ArrayList<Integer> left = new ArrayList<Integer>();
		left.add(0);
		ArrayList<Integer> right = new ArrayList<Integer>();
		right.add(0);
		if(isBalance(root.left,left)&&isBalance(root.right,right)){
			int dist = left.get(0) - right.get(0);
			if(dist > 1 || dist < -1)
				return false;
		}
		depth.add(0,Math.max(left.get(0), right.get(0)) + 1);
		return true;
	}