Question:medium

The set T represents various traversals over a binary tree. The set S represents the order of visiting nodes during a traversal. Which one of the following is the correct match from T to S?

Show Hint

To remember easily: "Pre", "In", and "Post" refer to the position of the root node. In all three, the Left subtree is always visited before the Right subtree.
Updated On: Mar 16, 2026
  • I - L, II - M, III - N
  • I - M, II - L, III - N
  • I - N, II - M, III - L
  • I - L, II - N, III - M
Show Solution

The Correct Option is A

Solution and Explanation

Step 1: Understanding the Concept:
Binary tree traversals are categorized based on when the root node is visited relative to the subtrees.
- Inorder: Left subtree, Root node, Right subtree.
- Preorder: Root node, Left subtree, Right subtree.
- Postorder: Left subtree, Right subtree, Root node.
Step 2: Detailed Explanation:
Let's define the sets based on standard definitions:
Set T consists of:
I. Inorder Traversal
II. Preorder Traversal
III. Postorder Traversal
Set S consists of:
L. Left $\rightarrow$ Root $\rightarrow$ Right
M. Root $\rightarrow$ Left $\rightarrow$ Right
N. Left $\rightarrow$ Right $\rightarrow$ Root
Matching the pairs:
- I matches with L (Inorder).
- II matches with M (Preorder).
- III matches with N (Postorder).
This gives the sequence I-L, II-M, III-N.
Step 3: Final Answer:
Matching option (A) correctly aligns the traversal type with its visiting sequence.
Was this answer helpful?
0