Data Structures & AlgorithmsModerateGATE CSE · Trees

Keys 45, 25, 65, 15, 35, 55, 75, 30 are inserted in this order into an empty binary search tree. What is its postorder traversal?

  1. A. 45 25 15 35 30 65 55 75
  2. B. 15 30 35 25 55 75 65 45
  3. C. 45 25 65 15 35 55 75 30
  4. D. 15 25 30 35 45 55 65 75

Correct answer: B. 15 30 35 25 55 75 65 45

Postorder visits left subtree, right subtree, then the node: 15, 30, 35, 25, 55, 75, 65, 45.

More Trees, Graphs, Recursion and Dynamic Programming questions

Exams that ask this topic