Recall & Review
beginner
What is the Boundary Traversal of a binary tree?
Boundary Traversal means visiting all the nodes on the boundary of the tree in an anti-clockwise direction starting from the root. It includes the left boundary, leaves, and right boundary.
Click to reveal answer
beginner
Which parts of the binary tree are included in the boundary traversal?
The boundary traversal includes three parts: 1) Left boundary (excluding leaves), 2) All leaf nodes (left to right), 3) Right boundary (excluding leaves, in bottom-up order).
Click to reveal answer
intermediate
How do you avoid printing leaf nodes twice in boundary traversal?
Leaf nodes are printed only once during the leaf traversal step. Left and right boundary traversals exclude leaf nodes to avoid duplicates.
Click to reveal answer
beginner
What is the order of traversal in boundary traversal of a binary tree?
The order is: root node → left boundary (top-down) → leaf nodes (left to right) → right boundary (bottom-up).
Click to reveal answer
intermediate
Why is the right boundary printed in bottom-up order in boundary traversal?
The right boundary is printed bottom-up to maintain the anti-clockwise direction of traversal around the tree boundary.
Click to reveal answer
Which nodes are NOT included in the left boundary traversal?
✗ Incorrect
Leaf nodes are excluded from the left boundary traversal to avoid duplication since they are printed separately.
In boundary traversal, when are leaf nodes printed?
✗ Incorrect
Leaf nodes are printed after the left boundary traversal and before the right boundary traversal.
What is the traversal direction of the right boundary in boundary traversal?
✗ Incorrect
The right boundary is traversed bottom-up to maintain the anti-clockwise order.
Which node is always the first node printed in boundary traversal?
✗ Incorrect
The root node is always printed first in boundary traversal.
If a binary tree has only one node, what is the boundary traversal output?
✗ Incorrect
If there is only one node, it is the root and also a leaf, so it is printed once.
Explain the steps to perform boundary traversal of a binary tree.
Think about the three parts of the boundary and their order.
You got /4 concepts.
How do you handle leaf nodes during boundary traversal to avoid duplicates?
Consider where leaf nodes appear in the traversal.
You got /2 concepts.