private Result isBalancedInternal(TreeNode root){
		if(root==null) return new Result(0,true);
		
		Result left=isBalancedInternal(root.left);
		if(!left.balanced) return new Result(0, false);
		
		Result right=isBalancedInternal(root.right);
		if(!right.balanced) return new Result(0, false);
		
		if(right.height-left.height>1 || left.height-right.height>1)
			return new Result(0,false);
		
		return new Result(1+Math.max(left.height,right.height), true);
	}