Multiple choice

The preorder traversal sequence of a binary search tree is 30, 20, 10, 15, 25, 23, 39, 35, 42. Which one of the following is the postorder traversal sequence of the same tree?

  1. 10, 20, 15, 23, 25, 35, 42, 39, 30

  2. 15, 10, 25, 23, 20, 42, 35, 39, 30

  3. 15, 20, 10, 23, 25, 42, 35, 39, 30

  4. 15, 10, 23, 25, 20, 35, 42, 39, 30

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

Preorder: 30, 20, 10, 15, 25, 23, 39, 35, 42 Postorder: 10, 15, 20, 23, 25, 30, 35, 39, 42