Skip to content

Commit 382184b

Browse files
committed
binary tree preorder iterator
1 parent 6c208c0 commit 382184b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

PuzzleCoding/src/BTreeIterator.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ public void remove() {
3030
throw new java.lang.UnsupportedOperationException("remove");
3131
}
3232

33-
public Node inOrderNext() {
34-
return next();
33+
public Node next() {
34+
return inOrderNext();
3535
}
3636

3737
// in-order
38-
public Node next() {
38+
public Node inOrderNext() {
3939
if (hasNext()) {
4040
Node node = stack.pop();
4141
pushLeft(node.right);

0 commit comments

Comments
 (0)