4.3.2.1 Simple tree-traversal algorithms Flashcards
1
Q
What is pre-order traversal?
A
checks root first, then left subtree then right
can make a complete duplicate of a binary tree.
ILR
2
Q
What is post-order traversal?
A
left subtree, right subtree, root
Infix to RPN (Reverse Polish Notation) conversions, producing a postfix expression from an expression tree, emptying a tree.
LRI
3
Q
What is in order traversal?
A
checks left subtree, root, then right
binary search tree, outputting the contents of a binary search tree in ascending order
LIR