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.SList< T >.Iterator< BinaryTree< T > >
boolean hasNext ()
 return true unless "advanced" over tail More...
 
next ()
 return current entry and advance More...
 
void remove ()
 not implemented More...
 
boolean equals (Object other)
 

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: