What is the order of visiting nodes in post-order traversal?
A
Root, Left, Right B
Left, Root, Right C
Left, Right, Root D
Right, Left, Root
Analysis & Theory
Post-order traversal visits nodes in the order: Left subtree, Right subtree, then Root.
Which traversal is often used to delete or free all nodes in a binary tree?
A
Pre-order traversal B
In-order traversal C
Post-order traversal D
Level-order traversal
Analysis & Theory
Post-order ensures children are processed before their parent, making it suitable for deletion.
Given this binary tree:
A
/ \
B C
/ \ \
D E F
What is its post-order traversal?
A
D E B F C A B
D B E F C A C
B D E C F A D
E D B F C A
Analysis & Theory
Post-order: D, E, B, F, C, A.
Which data structure is commonly used to implement iterative post-order traversal?
A
Queue B
Priority Queue C
Two Stacks D
Deque
Analysis & Theory
Two stacks are often used in iterative post-order traversal.
When is the root node visited in post-order traversal?
A
Before visiting any subtrees B
Between visiting the left and right subtrees C
After visiting the left subtree only D
After visiting both left and right subtrees
Analysis & Theory
Post-order visits the root after both subtrees are processed.
What is the time complexity of post-order traversal for a binary tree with n nodes?
A
O(1) B
O(log n) C
O(n) D
O(n log n)
Analysis & Theory
All nodes are visited once: O(n).
How many times does a post-order traversal visit each node?
A
Once B
Twice C
Three times D
Depends on the tree structure
Analysis & Theory
Each node is visited exactly once.
Which traversal of a binary expression tree produces the postfix expression?
A
Pre-order traversal B
In-order traversal C
Post-order traversal D
Level-order traversal
Analysis & Theory
Post-order traversal yields postfix notation.
Which of the following statements is TRUE about post-order traversal?
A
It processes the root before any children B
It processes the left subtree first, right subtree second, and root last C
It processes the root between left and right subtrees D
It is the same as in-order traversal
Analysis & Theory
Post-order: Left, Right, Root.
Which traversal is best for evaluating subtrees before combining results at the parent node?
A
In-order traversal B
Pre-order traversal C
Post-order traversal D
Level-order traversal
Analysis & Theory
Post-order is suitable for combining results after processing children.