class Solution {
public:
bool check(TreeNode * tr1 , TreeNode* tr2){
if(!tr1 && !tr2) return true;
if(!tr1 || !tr2) return false;
return (tr1->val == tr2->val ) &&
check(tr1->left , tr2->right) &&
check(tr1->right , tr2->left);
}
bool isSymmetric(TreeNode* root) {
if(!root) return true;
return check(root->left , root->right);
}
};
https://leetcode.com/problems/symmetric-tree/
https://takeuforward.org/data-structure/check-for-symmetrical-binary-tree/