The set T represents various traversals over 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 ?
Topic-wise GATE CS PYQs with verified steps
GATE CSE 2026 Set 2 · Q12
Time

Select one answerSingle correct
Solution
Official answer: A) I – L, II – M, III – N
TreesThe standard binary tree traversal definitions are:
Inorder Traversal (I): Visit the left subtree, then the root node, and then the right subtree (). Hence, I matches with L.
Preorder Traversal (II): Visit the root node, then the left subtree, and then the right subtree (). Hence, II matches with M.
Postorder Traversal (III): Visit the left subtree, then the right subtree, and finally the root node (). Hence, III matches with N.
Therefore, the correct mapping is I – L, II – M, III – N, which corresponds to option (A).
Try the question first, then check your work.
Examiner trap
Recall the prefix 'Pre-', 'In-', and 'Post-' refer to the position where the current node is processed relative to its left and right subtrees.
This Trees previous year question is Q12 of the GATE CSE 2026 Set 2 paper. Find more GATE CSE PYQs on Trees in Programming and Data Structures, or browse all GATE CSE PYQs.
Free diagnostic
Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 5 related Trees PYQs now with no account.
An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.
Trees has 13 GATE CSE PYQs across 11 papers from 2012 to 2026. 4 of them are 1-mark MCQs like this one, and it is the only one in GATE CSE 2026 Set 2.
How GATE tests TreesIndependent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.