The postorder traversal of a binary tree is ACEDBHIGF. The preorder traversal…

2020

The postorder traversal of a binary tree is ACEDBHIGF. The preorder traversal is:

Answer: E. None of theseConceptA traversal fixes only the order in which nodes are visited; it does not, by itself, describe every parent-child link. For a general binary tree,…

  1. A.

    ABCDEFGHI

  2. B.

    FBADCEGIH

  3. C.

    FABCDEGHI

  4. D.

    ABDCEFGIH

  5. E.

    None of these

Attempted by 554 students.

Show answer & explanation

Correct answer: E

Concept

A traversal fixes only the order in which nodes are visited; it does not, by itself, describe every parent-child link.

For a general binary tree, preorder and postorder together can correspond to more than one structure, while postorder alone cannot determine a unique preorder. An inorder traversal or an additional structural rule is needed for unique reconstruction.

Application

  1. In postorder, the last node is the root, so F must be the root.

  2. The preceding nodes ACEDBHIG do not reveal where F's left subtree ends and its right subtree begins. Different valid partitions therefore produce different trees.

  3. One valid tree has F with children B and G; B has children A and D; D has children C and E; G has child I; and I has child H. Its postorder is ACEDBHIGF and its preorder is FBADCEGIH.

  4. Another valid tree is a single-child chain F → G → I → H → B → D → E → C → A. Its postorder is also ACEDBHIGF, but its preorder is FGIHBDECA.

Cross-check

  • Both constructions end their postorder traversal at F, as required for the same root.

  • The two constructions reproduce the full supplied postorder sequence but yield different preorder sequences, proving non-uniqueness.

  • Treating the letters as a sorted inorder sequence would add a binary-search-tree assumption that the stem does not state.

Therefore, no unique preorder traversal can be selected from the supplied information; among the offered choices, the defensible response is “None of these”.

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Isro

Loading lesson…