Correct Answer (Detailed Explanation is Below)
B. 11, 12, 10, 16,19,18,20,15
Detailed Explanation
Explanation:
Preorder traversal (Root → Left → Right) is given:
15, 10, 12, 11, 20, 18, 16, 19
Step 1: Root
First element of preorder = 15 → Root
Split into BST parts:
Left subtree (<15): 10, 12, 11
Right subtree (>15): 20, 18, 16, 19
Left Subtree
Preorder: 10, 12, 11
Root = 10
Left of 10 → none
Right of 10 → 12, 11
Node 12:
Tree:
Postorder (Left → Right → Root):
11, 12, 10
Right Subtree
Preorder: 20, 18, 16, 19
Root = 20
Left subtree: 18, 16, 19
Node 18
Tree:
Postorder:
16, 19, 18, 20
Final Postorder
Left subtree + Right subtree + Root
11, 12, 10, 16, 19, 18, 20, 15