Skip to content

Commit 2988771

Browse files
committed
fd
1 parent d75dbda commit 2988771

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

leetcode/solution/src/SymmetricTree.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ public boolean isSymmetric2(TreeNode root) {
4949
return queue1.isEmpty() && queue2.isEmpty();
5050
}
5151

52+
/**
53+
* 基于isSymmetric2,不过只要一个queue就够了
54+
*/
5255
public boolean isSymmetri3(TreeNode root) {
5356
Queue<TreeNode> queue = new LinkedList<>();
5457
queue.offer(root);

0 commit comments

Comments
 (0)