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

Keys 77, 23, 72, 58, 94, 42, 92 are inserted in this order into an empty BST. What is the postorder traversal?

  1. A. [23, 42, 58, 72, 77, 92, 94]
  2. B. [42, 58, 72, 23, 94, 92, 77]
  3. C. [42, 58, 72, 23, 92, 94, 77]
  4. D. [77, 23, 72, 58, 42, 94, 92]

Correct answer: C. [42, 58, 72, 23, 92, 94, 77]

Insert in order to build the BST (root 77); postorder visits left, right, root, giving [42, 58, 72, 23, 92, 94, 77].

More Trees, Graphs, Recursion and Dynamic Programming questions

Exams that ask this topic