AuD
Lecture 'Algorithmen und Datenstrukturen' (code examples)
aud.BinaryTreeTraversal< T >.PreorderIterator Class Reference

preorder iterator for BinaryTree More...

+ Inheritance diagram for aud.BinaryTreeTraversal< T >.PreorderIterator:
+ Collaboration diagram for aud.BinaryTreeTraversal< T >.PreorderIterator:

Public Member Functions

BinaryTree< T > next ()
 
- Public Member Functions inherited from aud.BinaryTreeTraversal< T >.RecursiveTraversalIterator
boolean hasNext ()
 
void remove ()
 
- Public Member Functions inherited from aud.BinarySearchTree.Iterator< BinaryTree< T > >
boolean hasNext ()
 
Cursor next ()
 
void remove ()
 not implemented More...
 

Detailed Description

preorder iterator for BinaryTree

Definition at line 54 of file BinaryTreeTraversal.java.

Member Function Documentation

◆ next()

BinaryTree< T > aud.BinaryTreeTraversal< T >.PreorderIterator.next ( )

Definition at line 58 of file BinaryTreeTraversal.java.

58 {
59 BinaryTree<T> node=stack_.pop(); // may throw!
60 if (node.getRight()!=null) stack_.push(node.getRight());
61 if (node.getLeft()!=null) stack_.push(node.getLeft());
62 return node;
63 }

The documentation for this class was generated from the following file: