✅ C++ solution | Easy to understand | O(N)
Complexity\n- Time complexity: O(1)\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# Co
# Complexity\n- Time complexity: O(1)\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```\nclass Solution {\npublic:\n    bool isEqual(TreeNode* left, TreeNode* right) {\n        if (!left && !right)\n            return true;\n        \n        if (!left || !right || left->val != right->val)\n            return false;\n        \n        return isEqual(left->left, right->right) && isEqual(left->right, right->left);\n    }\n    bool isSymmetric(TreeNode* root) {\n        return isEqual(root->left, root->right);\n    }\n};\n```
['Tree', 'C', 'Binary Tree', 'C++']