GateAI
Binary Search Trees

GATE CSE 2015 Set 1 · Q10

MCQ1 markEasy

Time

Which of the following is/are correct inorder traversal sequence(s) of binary search tree(s)? I. 3,5,7,8,15,19,253, 5, 7, 8, 15, 19, 25 II. 5,8,9,12,10,15,255, 8, 9, 12, 10, 15, 25 III. 2,7,10,8,14,16,202, 7, 10, 8, 14, 16, 20 IV. 4,6,7,9,18,20,254, 6, 7, 9, 18, 20, 25

Select one answerSingle correct

Pick an option to check

Solution

Step-by-step verified solution

Official answer: A) I and IV only

Binary Search Trees

A 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. 3,5,7,8,15,19,253, 5, 7, 8, 15, 19, 25 is strictly in ascending order   ⟹  \implies Valid inorder sequence.

  • II. 5,8,9,12,10,15,255, 8, 9, 12, 10, 15, 25 is not sorted because 12>1012 > 10   ⟹  \implies Invalid.

  • III. 2,7,10,8,14,16,202, 7, 10, 8, 14, 16, 20 is not sorted because 10>810 > 8   ⟹  \implies Invalid.

  • IV. 4,6,7,9,18,20,254, 6, 7, 9, 18, 20, 25 is strictly in ascending order   ⟹  \implies 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.

Think the official key or this write-up is wrong?

Report error or challenge

Examiner trap

The misconception this question tests

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

Where do you stand for GATE?

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.

One GATE CSE PYQ every morning

An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.

Binary Search Trees in GATE CSE

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 Trees

More from GATE CSE 2015 Set 1

Share this solution

A plain-text card for WhatsApp or Telegram study groups.

GateAI solution cardGATE CSE 2015 Set 1 · Q10 · MCQ

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

Independent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.