We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 2a95f14 + 3a2fd44 commit 547d29bCopy full SHA for 547d29b
2018.12.4-leetcode101/啦啦啦.md
@@ -0,0 +1,22 @@
1
+```java
2
+/**
3
+ * Definition for a binary tree node.
4
+ * public class TreeNode {
5
+ * int val;
6
+ * TreeNode left;
7
+ * TreeNode right;
8
+ * TreeNode(int x) { val = x; }
9
+ * }
10
+ */
11
+class Solution {
12
+ public boolean isSymmetric(TreeNode root) {
13
+ return cal(root,root);
14
+ }
15
+
16
+ boolean cal(TreeNode r1,TreeNode r2){
17
+ if(r1==null&&r2==null)return true;
18
+ if(r1==null||r2==null)return false;
19
+ return r1.val==r2.val&&cal(r1.left,r2.right)&&cal(r1.right,r2.left);
20
21
+}
22
+```
0 commit comments