Question:

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
Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is A

Solution and Explanation

Step 1: Understanding the Concept
Binary tree traversal involves visiting all nodes of a tree in a specific order. Depth-first traversals depend on when the root node is visited relative to its subtrees.

Step 2: Traversal Rules
- Inorder: Left Subtree → Node → Right Subtree
- Preorder: Node → Left Subtree → Right Subtree
- Postorder: Left Subtree → Right Subtree → Node

Step 3: Matching Sequences
Based on the table:
1. Inorder (I): Sequence is left subtree, node, right subtree → matches L
2. Preorder (II): Sequence is node, left subtree, right subtree → matches M
3. Postorder (III): Sequence is left subtree, right subtree, node → matches N
Correct mapping: I-L, II-M, III-N

Step 4: Final Answer
Option (A)
Was this answer helpful?
0
0