CMSC 132A Lecture Notes - Lecture 37: Tree Traversal

103 views3 pages
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) {
Unlock document

This preview shows page 1 of the document.
Unlock all 3 pages and 3 million more documents.

Already have an account? Log in

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers