Tree Transversals Flashcards
1
Q
Depth Transversal
A
Starts at the root and prioritises visiting all nodes in a subtree before moving to sibling nodes
2
Q
Breadth-First Transversal
A
Starts at the root and visits all nodes at a given level before proceeding to the next level. The order of visiting nodes within a level is not strictly defined.
3
Q
Pre-Order Transversal
A
VLR
4
Q
In-Order Transversal
A
LVR
5
Q
Post-Order Transversal
A
LRV
6
Q
What is the significance of Visits?
A
Merely visiting nodes is insufficient; the action performed during the “visit” is crucial. Choosing the right traversal type and “visit” operation allows for the efficient execution of various tasks on the tree data structure.