Question
Recursively find whether the values of the current left and right nodes are equal and whether the left node of the current left node is equal to the right node of the current right node and the right node of the current left node is equal to the left node of the current right node
public Boolean recur(TreeNode left ,TreeNode right){
if (left == null && right == null) return true;
if (left == null || right == null) return false;
return ((left.val == right.val) && recur(left.left,right.right) && recur(left.right,right.left));
}
public boolean isSymmetric(TreeNode root) {
if (root == null) return true;
return recur(root.left,root.right);
}