CS 3.2. (ALEVEL) Tree-Traversal Flashcards
(3 cards)
1
Q
Pre-order
A
- used for copying a tree
- visits node when it passes left of it
2
Q
In-order
A
- only for binary trees
-Visits nodes when it passes the bottom of the node - a function of In-order is outputting in alphabetical order
3
Q
Post-order
A
- useful for infix to RPN conversions (PMT has an example)
- visits nodes when it passes the right of the node