Skip to content

Commit

Permalink
Chapter 05 section 06 java Queue interface used in BST level order tr…
Browse files Browse the repository at this point in the history
…averse.
  • Loading branch information
liuyubobobo committed May 1, 2018
1 parent c126be7 commit ec64aff
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package bobo.algo;

import java.util.LinkedList;
import java.util.Queue;

// 二分搜索树
// 由于Key需要能够进行比较,所以需要extends Comparable<Key>
Expand Down Expand Up @@ -72,7 +73,7 @@ public void postOrder(){
public void levelOrder(){

// 我们使用LinkedList来作为我们的队列
LinkedList<Node> q = new LinkedList<Node>();
Queue<Node> q = new LinkedList<Node>();
q.add(root);
while( !q.isEmpty() ){

Expand Down

0 comments on commit ec64aff

Please sign in to comment.