# Easy-题目25：101. Symmetric Tree

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

（1） 空树是轴对称的。
（2） 轴对称的两棵子树tree1和tree2应满足以下递归条件：
a) 对应值相等；
b) Tree1的右子树和tree2的左子树是轴对称的；
c) Tree1的左子树和tree2的右子树的轴对称的。

public class Solution {
public boolean isSymmetric(TreeNode root) {
if(root== null)
return true;
return isSymmetric(root.left, root.right);
}

public boolean isSymmetric(TreeNode tree1, TreeNode tree2){
if(tree1==null && tree2==null)
return true;
else if(tree1 == null || tree2 == null || tree1.val != tree2.val)
return false;
else
return isSymmetric(tree1.left, tree2.right) && isSymmetric(tree1.right, tree2.left);
}
}

1ms，beats21.41%，众数1ms，78.59%
Cmershen的碎碎念：

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

2016-05-30 23:06:35

#### 101. Symmetric Tree Leetcode Python

2015-01-30 07:28:30

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

2016-06-03 15:53:34

#### LeetCode: 101. Symmetric Tree

2018-03-21 09:40:38

#### [leetcode] 101. Symmetric Tree

2016-07-13 16:06:07

#### LeetCode - 101. Symmetric Tree

2017-01-18 19:49:22

#### 【LeetCode】 101. Symmetric Tree

2016-12-19 12:09:08

#### DFS:101. Symmetric Tree

2017-09-23 22:35:18

#### [BFS]101. Symmetric Tree

2017-04-25 12:24:59

#### [Leetcode] 101. Symmetric Tree

2015-04-03 22:29:18