Data Structures & AlgorithmsVery hardGATE CS · TCS NQT · Product Company SDE

Keys 12, 54, 92, 89, 71, 88, 69 are inserted in this order into an empty BST. What is the postorder traversal?

  1. A. [12, 54, 69, 71, 88, 89, 92]
  2. B. [12, 54, 92, 89, 71, 69, 88]
  3. C. [69, 88, 71, 89, 54, 92, 12]
  4. D. [69, 88, 71, 89, 92, 54, 12]

Correct answer: D. [69, 88, 71, 89, 92, 54, 12]

Insert in order to build the BST (root 12); postorder visits left, right, root, giving [69, 88, 71, 89, 92, 54, 12].

More Trees, Graphs, Recursion and Dynamic Programming questions

Exams that ask this topic