GateAI
Binary Search Trees

GATE CSE 2020 · Q5

MCQ1 markEasy

Time

The preorder traversal of a binary search tree is 15, 10, 12, 11, 20, 18, 16, 19. Which one of the following is the postorder traversal of the tree?

Select one answerSingle correct

Pick an option to check

Solution

Step-by-step verified solution

Official answer: B) 11, 12, 10, 16, 19, 18, 20, 15

Binary Search Trees

Given the preorder traversal of a Binary Search Tree (BST):

Preorder: [15,10,12,11,20,18,16,19]\text{Preorder: } [15, 10, 12, 11, 20, 18, 16, 19]

In a BST, all elements in the left subtree are smaller than the root, and all elements in the right subtree are greater than the root.

  1. Root: 1515

  2. Left Subtree of 1515: elements less than 15  ⟹  [10,12,11]15 \implies [10, 12, 11]

    • Root is 1010.

    • Right child of 1010 is 1212.

    • Left child of 1212 is 1111.

  3. Right Subtree of 1515: elements greater than 15  ⟹  [20,18,16,19]15 \implies [20, 18, 16, 19]

    • Root is 2020.

    • Left child of 2020 is 1818.

    • Left child of 1818 is 1616; right child of 1818 is 1919.

Now, perform Postorder traversal (Left →\to Right →\to Root):

  • Postorder of left subtree of 1515: 11,12,1011, 12, 10

  • Postorder of right subtree of 1515: 16,19,18,2016, 19, 18, 20

  • Root: 1515

Combining these gives the complete postorder traversal:

11,12,10,16,19,18,20,1511, 12, 10, 16, 19, 18, 20, 15

Therefore, option (B) is correct.

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 Q5 of the GATE CSE 2020 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 2020 has 2.

How GATE tests Binary Search Trees

More from GATE CSE 2020

Share this solution

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

GateAI solution cardGATE CSE 2020 · Q5 · MCQ

The preorder traversal of a binary search tree is 15, 10, 12, 11, 20, 18, 16, 19. Which one of the following is the postorder traversal of the tree?

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.