# 101. Symmetric Tree

Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).

For example, this binary tree is symmetric:

    1
/ \
2   2
/ \ / \
3  4 4  3


But the following is not:

    1
/ \
2   2
\   \
3    3


class Solution {
public:
bool isSymmetric(TreeNode* root) {
if(!root) return 1;
return helper(root->left,root->right);
}

bool helper(TreeNode* left,TreeNode* right){
if(!left&&!right)return 1;
else if(!left||!right) return 0;

if(left->val!=right->val) return 0;

return helper(left->left,right->right)&&helper(left->right,right->left);
}
};

#### LeetCode(101)Symmetric Tree

2014-01-17 06:48:54

#### 【LeetCode】101. Symmetric Tree 解题报告

2016-05-30 23:06:35

#### 【LeetCode-面试算法经典-Java实现】【101-Symmetric Tree（对称树）】

2015-08-07 07:29:25

#### 101. Symmetric Tree Leetcode Python

2015-01-30 07:28:30

#### 101. Symmetric Tree [easy] (Python)

2016-06-03 15:53:34

#### 【leetcode c++】101 Symmetric Tree

2015-07-27 14:39:02

#### LeetCode之 101. Symmetric Tree python

2018-04-24 15:19:29

#### Leetcode-Symmetric Tree——判断二叉树是否对称

2014-04-20 01:00:22

#### Symmetric Tree -- LeetCode

2014-04-07 04:52:23

#### Leetcode-Easy 101. Symmetric Tree

2018-04-03 00:22:00