All Packages  Class Hierarchy  This Package  Previous  Next  Index  

Class DataStructures.LevelOrder

java.lang.Object
    |
    +----DataStructures.TreeIterator
            |
            +----DataStructures.LevelOrder

public class LevelOrder
extends TreeIterator
Level-order iterator class.


Constructor Index

 o LevelOrder(BinarySearchTree)
Construct the iterator.

Method Index

 o advance()
Advance the current position to the next node in the tree, according to the level-order traversal scheme.
 o first()
Set the current position to the first item, according to the level-order traversal scheme.

Constructors

 o LevelOrder
public LevelOrder(BinarySearchTree theTree)
Construct the iterator. The current position is set to null.

Parameters:
theTree - the tree to which the iterator is permanently bound.

Methods

 o first
public void first()
Set the current position to the first item, according to the level-order traversal scheme.

Overrides:
first in class TreeIterator
 o advance
public void advance() throws ItemNotFound
Advance the current position to the next node in the tree, according to the level-order traversal scheme.

Throws: ItemNotFound
if the current position is null.
Overrides:
advance in class TreeIterator

All Packages  Class Hierarchy  This Package  Previous  Next  Index