Data Structures & AlgorithmsHardGATE CS · TCS NQT · Product Company SDE

Keys 81, 18, 92, 48, 71, 55, 44, 41 are inserted in this order into an empty BST. What is the postorder traversal?

  1. A. [18, 41, 44, 48, 55, 71, 81, 92]
  2. B. [41, 44, 55, 71, 48, 18, 92, 81]
  3. C. [81, 18, 48, 44, 41, 71, 55, 92]
  4. D. [41, 44, 55, 71, 48, 92, 18, 81]

Correct answer: B. [41, 44, 55, 71, 48, 18, 92, 81]

Insert in order to build the BST (root 81); postorder visits left, right, root, giving [41, 44, 55, 71, 48, 18, 92, 81].

More Trees, Graphs, Recursion and Dynamic Programming questions

Exams that ask this topic