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?
Show answerHide answer
Correct answer: (B) 11, 12, 10, 16,19,18,20,15
Explanation
Root 15. The left subtree from 10, 12, 11 is 10 with right child 12, whose left child is 11. The right subtree is 20 with left child 18, whose children are 16 and 19. Postorder: 11, 12, 10, 16, 19, 18, 20, 15.