Skip to content
GATEiit

GATE DA 2024 Q28: Traversal pairs that rebuild a full binary tree

Question

Consider the following tree traversals on a full binary tree:

(i) Preorder

(ii) Inorder

(iii) Postorder

Which of the following traversal options is/are sufficient to uniquely reconstruct the full binary tree?

Try it: multiple select: one or more correct options

Select one or more options
Select all correct options. No negative marking, no partial marks.
Show answer and explanation

Answer: A, B, C (official GATE 2024 final answer key)

Concept used: Tree reconstruction: inorder plus preorder or postorder always works; preorder plus postorder works when every node has 0 or 2 children.

First step: In a full binary tree the node after the root in preorder must be the left child, which splits the postorder sequence; inorder alone has many trees.

Full step-by-step solution

Detailed working, common mistakes and linked mock tests will be available with a free GATEiit account. Log-in is coming soon.

Share this question

WhatsAppDownload image

Source: official GATE 2024 DA question paper and final answer key, organised by IISc Bangalore. Question paper · Answer key