GATE 2013 CS (CS1) – Question 53
A BST has preorder 30,20,10,15,25,23,39,35,42. Find its postorder.
Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: (D) 15,10,23,25,20,35,42,39,30
Explanation
Root thirty separates left subtree 20,10,15,25,23 and right subtree 39,35,42. Left postorder is 15,10,23,25,20; right postorder is 35,42,39. Append root thirty to obtain D. Each recursive split follows the BST ordering property.