Which of the following is/are correct inorder traversal sequence(s) of binary search tree(s)? I. 3, 5, 7, 8, 15, 19, 25 II. 5, 8, 9, 12, 10, 15, 25 III. 2, 7, 10, 8, 14, 16, 20 IV. 4, 6, 7, 9, 18, 20, 25
Topic-wise GATE CS PYQs with verified steps
GATE CSE 2015 Set 1 · Q10
Time
Select one answerSingle correct
Solution
Official answer: A) I and IV only
Binary Search TreesA fundamental property of a Binary Search Tree (BST) is that its inorder traversal always visits the nodes in strictly non-decreasing (sorted) order.
Let us check each sequence:
I. is strictly in ascending order Valid inorder sequence.
II. is not sorted because Invalid.
III. is not sorted because Invalid.
IV. is strictly in ascending order Valid inorder sequence.
Therefore, only I and IV are correct inorder traversal sequences.
Hence, (A) is the correct option.
Try the question first, then check your work.
Examiner trap
Recall that the inorder traversal of any valid binary search tree always yields elements in sorted (ascending) order.
This Binary Search Trees previous year question is Q10 of the GATE CSE 2015 Set 1 paper. Find more GATE CSE PYQs on Binary Search 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 Binary Search 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.
Binary Search Trees has 21 GATE CSE PYQs across 17 papers from 2011 to 2026. 8 of them are 1-mark MCQs like this one, and GATE CSE 2015 Set 1 has 2.
How GATE tests Binary Search TreesIndependent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.