```
bool DFS(TreeNode *left,TreeNode *right)
{
if(left == NULL || right == NULL)
return left == right;
return (left->val == right->val)&DFS(left->right,right->left)&DFS(left->left,right->right);
}
bool isSymmetric(TreeNode *root) {
if(root == NULL)
return true;
return DFS(root->left,root->right);
}
```