All Exams Test series for 1 year @ ₹349 only
Question

Postorder traversal of a given binary search tree T produces following sequence of keys: 3, 5, 7, 9, 4, 17, 16, 20, 18, 15, 14 Which one of the following sequences of keys can be the result of an in-order traversal of the tree T?

The correct answer is

3, 4, 5, 7, 9, 14, 15, 16, 17, 18, 20

An inorder traversal of a binary search tree visits its distinct keys in ascending order. Sorting the keys in the supplied postorder traversal therefore gives 3, 4, 5, 7, 9, 14, 15, 16, 17, 18, 20.

Was this answer helpful?

Important Questions from Tree Traversal - Teaching

  1. Consider the traversal of a tree

    Preorder → ABCEIFJDGHKL

    Inorder → EICFJBGDKHLA

    Which of the following is correct post order traversal?

  2. The inorder traversal of the following tree is :

  3. Level order Traversal of a rooted Tree can be done by starting from root and performing :

  4. The inorder and preorder Traversal of binary Tree are dbeafcg and abdecfg respectively. The post-order Traversal is __________.

  5. Arrange the following steps of the Inorder Traversal of Binary Tree in the correct order.

    A. Visit the Left subtree

    B. Visit the Root node

    C. Visit the Right subtree

    D. Start traversing by visiting the nodes in rooted tree

    E. Repeat the above three steps.

    Choose the correct answer from the options given below:

Need Expert Advice?

Start Your Preparation with Prepp Mobile App

Download the app from Google Play & App Store
Download the app from Google Play & App Store
Prepp Mobile App