☕Java Solution | 🚀0ms Runtime - beats 100%🔥| Easy to Understand😇
Intuition\n Describe your first thoughts on how to solve this problem. \nBy seeing the problem my first intuition was to use BFS to solve the problem,by taking 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nBy seeing the problem my first intuition was to use BFS to solve the problem,by taking a queue but as i approached the problem i understand that using DFS is more optimal and less complex to solve this problem.\n# Approach\n<!-- Describe your approach to solving the problem. -->\nThere are two parts of the tree - the left one and the right one.\n**Some Observations :**\n- The `leftnode` of left subtree is equal to the `rightnode` of right subtree.\n- Similarly the `rightnode` of left subtree is equal to the `leftnode` of right subtree.\n\nSo we can apply these recursively to check if the nodes are equal or not.\nIf the tree is symmetric then the algorithm reaches the leaf nodes where each node is null, then we return `true`.\n# Complexity\n- Time complexity: O(n)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(1)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\n/**\n * Definition for a binary tree node.\n * public class TreeNode {\n *     int val;\n *     TreeNode left;\n *     TreeNode right;\n *     TreeNode() {}\n *     TreeNode(int val) { this.val = val; }\n *     TreeNode(int val, TreeNode left, TreeNode right) {\n *         this.val = val;\n *         this.left = left;\n *         this.right = right;\n *     }\n * }\n */\nclass Solution {\n    public boolean isSymmetric(TreeNode root) {\n        if(root == null){\n            return true;\n        }\n        return checkSymmetric(root.left,root.right);\n    }\n    public boolean checkSymmetric(TreeNode leftNode,TreeNode rightNode){\n        if(leftNode == null && rightNode == null){\n            return true;\n        }\n        if(leftNode == null ^ rightNode == null){\n            return false;\n        }\n        if(leftNode.val != rightNode.val){\n            return false;\n        }\n        return checkSymmetric(leftNode.left,rightNode.right) && checkSymmetric(leftNode.right,rightNode.left);\n\n    }\n}\n```\nIf any doubt or suggestions, Please do comment :)\n\nPLEASE DO UPVOTE GUYS!!! :)\n\nThank You!!!
['Tree', 'Depth-First Search', 'Recursion', 'Java']