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?

Asked In: BPSC TRE 3.0

Options

  • A. 20, 19, 18, 16, 15, 12, 11, 10
  • B. 11, 12, 10, 16, 19, 18, 20, 15
  • C. 19, 16, 18, 20, 11, 12, 10, 15
  • D. More than one of the above
  • E. None of the above

Correct Answer (Detailed Explanation is Below)

B. 11, 12, 10, 16, 19, 18, 20, 15

Detailed Explanation

In a Binary Search Tree (BST), values smaller than a node are placed in its left subtree and larger values in its right subtree. The given preorder begins with 15, so 15 is the root. The resulting left subtree contains 10, 12 and 11, while the right subtree contains 20, 18, 16 and 19. Postorder traversal follows Left → Right → Root, producing 11, 12, 10, 16, 19, 18, 20, 15.