Data Structures & AlgorithmsHardGATE CS · ICPC regional · Product Company SDE

Keys 23, 80, 66, 86, 46, 82, 50 are inserted one by one into an empty binary search tree. What is the post-order traversal?

  1. A. [50, 46, 66, 82, 86, 80, 23]
  2. B. [23, 46, 50, 66, 80, 82, 86]
  3. C. [23, 80, 66, 46, 50, 86, 82]
  4. D. [23, 80, 66, 86, 46, 82, 50]

Correct answer: A. [50, 46, 66, 82, 86, 80, 23]

Build the BST by inserting in order (root 23). post-order gives [50, 46, 66, 82, 86, 80, 23]. The other traversals of the same tree are the distractors.

More Trees, Graphs, Recursion and Dynamic Programming questions

Exams that ask this topic