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
GATE CSE 2020 · Q5
Time
Select one answerSingle correct
Solution
Official answer: B) 11, 12, 10, 16, 19, 18, 20, 15
Binary Search TreesGiven the preorder traversal of a Binary Search Tree (BST):
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.
Root:
Left Subtree of : elements less than
Root is .
Right child of is .
Left child of is .
Right Subtree of : elements greater than
Root is .
Left child of is .
Left child of is ; right child of is .
Now, perform Postorder traversal (Left Right Root):
Postorder of left subtree of :
Postorder of right subtree of :
Root:
Combining these gives the complete postorder traversal:
Therefore, option (B) is correct.
Try the question first, then check your work.
Examiner trap
The first node in preorder traversal is the root. Use the BST property to divide the remaining nodes into left and right subtrees, construct the tree, and then perform a Left-Right-Root traversal.
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
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 2020 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.