GATE DA 2026 Set 1 — Question 25
Go beyond PYQs with Success TrackerAI-powered personalised practice and doubt support. Unlimited practice on eligible plans; AI usage limits apply.MSQ+1 / -0EasyBinary Tree TraversalsTreesProgramming, Data Structures & Algorithms
Programming, Data Structures & Algorithms → Trees → Binary Tree Traversals
Last updated
Question
You are given the following Pre-order and In-order traversals of a Binary Tree T with nodes E, F, G, P, Q, R, S.Pre-order: P Q S E R F GIn-order: S Q E P F R GWhich of the following statements is/are true about the Binary Tree T?
Correct answer
(A) Node P is the root of T; (B) The Post-order traversal of T is: S E Q F G R P
Solution
To reconstruct the binary tree from Pre-order and In-order traversals:
Post-order Traversal (Left, Right, Root):
1.Pre-order starts with the root. First element is P. So, P is the root. (Statement A is TRUE).
2.In In-order, elements to the left of P are in the left subtree, and elements to the right are in the right subtree.
- Left Subtree In-order: S Q E
- Right Subtree In-order: F R G
- Pre-order for left subtree (next 3 elements): Q S E.
- Root is Q.
- In-order S Q E implies S is left of Q, E is right of Q.
- Structure: Q is parent, S is left child, E is right child. (Statement C is FALSE as Q has two children).
- Pre-order for right subtree (remaining elements): R F G.
- Root is R.
- In-order F R G implies F is left of R, G is right of R.
- Structure: R is parent, F is left child, G is right child. (Statement D is FALSE as G is in the right subtree of R).
P
/ \
Q R
/ \ / \
S E F G
- Left Subtree (Root Q): Left(S), Right(E), Root(Q) S E Q
- Right Subtree (Root R): Left(F), Right(G), Root(R) F G R
- Main Root: P
- Full Post-order: S E Q F G R P. (Statement B is TRUE).
Continue learning with Success Tracker
A step still unclear? Work through it with support
Use Success Tracker to ask about the reasoning, then try another GATE DA question to check your understanding.
AI-powered practice· Unlimited practice on eligible plans
- PYQs with solutions
- Attempt available previous-year questions, then compare your reasoning with the worked solution. Coverage varies by stream.
- Practice that adapts
- Choose a topic, work on weaker areas and bookmark questions to revisit. Your attempts feed your progress tracking.
- AI doubt support
- Ask follow-up questions about a step or concept while practising, instead of stopping at the final answer.
Unlimited practice is available on eligible plans. Free practice and AI usage have limits; check the current plan allowances before choosing.
This page stays readable without an account. AI responses can be wrong; check them against the solution and source material.
More questions on Trees
2026 Set 1 Q15Consider that the quick sort algorithm is used to sort an array of distinct randomly ordered…2026 Set 1 Q16Consider the given Python program. [code] Which of the following is the correct output of this…2026 Set 1 Q31Let A be a sorted array containing 1000 distinct integers. You perform a recursive binary search on…2026 Set 1 Q39A recursive function in Python is given. [code] Now, consider the following function call:…2026 Set 1 Q40Consider a directed graph , where is the finite set of vertices and is the set…