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.
1 parent d75dbda commit 2988771Copy full SHA for 2988771
leetcode/solution/src/SymmetricTree.java
@@ -49,6 +49,9 @@ public boolean isSymmetric2(TreeNode root) {
49
return queue1.isEmpty() && queue2.isEmpty();
50
}
51
52
+ /**
53
+ * 基于isSymmetric2,不过只要一个queue就够了
54
+ */
55
public boolean isSymmetri3(TreeNode root) {
56
Queue<TreeNode> queue = new LinkedList<>();
57
queue.offer(root);
0 commit comments