CMSC 132A Lecture Notes - Lecture 37: Tree Traversal
CMSC132A Lecture 37: Tree traversals
Exam location on the website is not correct! Correct location is posted on Piazza! The
exam is May 14th from 4-6 PM at PHY 1410.
Let’s redo what we tried to do on Monday.
First, we will talk about tree traversals.
Interface TreeTraversal<X> {
TreeTraversal<X> next();
X get();
Boolean hasNext();
}
Class TreeIterator<X> implements Iterator<X> {
Pre-Order
Class NLR<X> implements TreeTraversal<X> {
Node<X. Node;
Listof<Node<X>>=context;
NLR(Node<X> node, LisfOf<Node<X>> context) {