```
class Solution {
public:
bool isSymmetric(TreeNode* root) {
if(!root) return true;
return recursion_isSymmetric(root->left,root->right);
}
bool recursion_isSymmetric(TreeNode* left,TreeNode* right){
if(!left&&!right) return true;
else if(left&& right){
if(left->val!=right->val) return false;
return recursion_isSymmetric(left->left,right->right)&&recursion_isSymmetric(left->right,right->left);
}
else return false;
}
};
```