Recall & Review
beginner
What is the Boundary Traversal of a binary tree?
It is a way to visit all the nodes on the boundary of a binary tree. This includes the left boundary (top to bottom), all leaf nodes (left to right), and the right boundary (bottom to top).
Click to reveal answer
beginner
Which nodes are included in the left boundary during boundary traversal?
All nodes on the path from the root to the left-most leaf, excluding leaf nodes if they are already counted in the leaf nodes section.
Click to reveal answer
intermediate
Why do we exclude leaf nodes from the left and right boundaries when doing boundary traversal?
Because leaf nodes are already included separately in the leaf nodes section to avoid duplication in the traversal output.
Click to reveal answer
intermediate
In boundary traversal, how is the right boundary collected and added to the result?
The right boundary nodes are collected from the bottom up (excluding leaf nodes) and added after the leaf nodes to maintain the correct order.
Click to reveal answer
beginner
What is the time complexity of boundary traversal of a binary tree with n nodes?
The time complexity is O(n) because each node is visited at most once during the traversal.
Click to reveal answer
Which of the following is NOT part of the boundary traversal of a binary tree?
✗ Incorrect
Boundary traversal includes left boundary, leaf nodes, and right boundary, but not all internal nodes.
In boundary traversal, leaf nodes are visited in which order?
✗ Incorrect
Leaf nodes are visited from left to right to maintain the boundary order.
When collecting the right boundary nodes, how should they be added to the final output?
✗ Incorrect
Right boundary nodes are added from bottom to top to maintain the correct boundary order.
What is the first step in performing boundary traversal of a binary tree?
✗ Incorrect
The root node is added first as it is part of the boundary.
If a binary tree has only one node, what will be the boundary traversal output?
✗ Incorrect
If there is only one node, it is both the root and a leaf, so the output is just that node.
Explain the steps to perform boundary traversal of a binary tree.
Think about the order in which boundary nodes appear around the tree.
You got /4 concepts.
Describe why leaf nodes are handled separately in boundary traversal.
Consider how nodes could be counted twice if not careful.
You got /4 concepts.