Skip to content

Commit 4981f7b

Browse files
committed
fix: fix 101
1 parent d54abce commit 4981f7b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

note/101/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,13 @@ Bonus points if you could solve it both recursively and iteratively.
4747
*/
4848
class Solution {
4949
public boolean isSymmetric(TreeNode root) {
50-
return root == null || isSymmetricHelper(root.left, root.right);
50+
return root == null || helper(root.left, root.right);
5151
}
5252

5353
public boolean helper(TreeNode left, TreeNode right) {
5454
if (left == null || right == null) return left == right;
5555
if (left.val != right.val) return false;
56-
return isSymmetricHelper(left.left, right.right) && isSymmetricHelper(left.right, right.left);
56+
return helper(left.left, right.right) && helper(left.right, right.left);
5757
}
5858
}
5959
```

src/com/blankj/easy/_101/Solution.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@
1515
*/
1616
public class Solution {
1717
// public boolean isSymmetric(TreeNode root) {
18-
// return root == null || isSymmetricHelper(root.left, root.right);
18+
// return root == null || helper(root.left, root.right);
1919
// }
2020
//
2121
// private boolean helper(TreeNode left, TreeNode right) {
2222
// if (left == null || right == null) return left == right;
2323
// if (left.val != right.val) return false;
24-
// return isSymmetricHelper(left.left, right.right) && isSymmetricHelper(left.right, right.left);
24+
// return helper(left.left, right.right) && helper(left.right, right.left);
2525
// }
2626

2727
public boolean isSymmetric(TreeNode root) {

0 commit comments

Comments
 (0)