public int getHeight(TreeNode root){
    	if(root.left == null && root.right == null) return 1;

    	int leftHeight = 0, rightHeight = 0;
    	if(root.left != null) leftHeight = getHeight(root.left);
    	if(root.right != null) rightHeight = getHeight(root.right);

    	if(Math.abs(leftHeight - rightHeight) > 1) result = false;

    	return Math.max(leftHeight, rightHeight) + 1;

    }