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 c126be7 commit ec64affCopy full SHA for ec64aff
05-Binary-Search-Tree/Course Code (Java)/06-Binary-Search-Tree-Level-Traverse/src/bobo/algo/BST.java
@@ -1,6 +1,7 @@
1
package bobo.algo;
2
3
import java.util.LinkedList;
4
+import java.util.Queue;
5
6
// 二分搜索树
7
// 由于Key需要能够进行比较,所以需要extends Comparable<Key>
@@ -72,7 +73,7 @@ public void postOrder(){
72
73
public void levelOrder(){
74
75
// 我们使用LinkedList来作为我们的队列
- LinkedList<Node> q = new LinkedList<Node>();
76
+ Queue<Node> q = new LinkedList<Node>();
77
q.add(root);
78
while( !q.isEmpty() ){
79
0 commit comments