Pre-order: P Q S E R F G
In-order: S Q E P F R G
Which of the following statements is/are true about the Binary Tree T?
["A","B"]
Step-by-Step Solution
Insight: Reconstruct the tree using the standard Pre-order and In-order split method.
Exam route: Root is P. Left In-order has 3 elements, Right has 3. Split Pre-order accordingly. Build left and right subtrees. Check options.
Learning route:
Step 1: Root is the first element in Pre-order: P.
Step 2: Find P in In-order. Left of P is S, Q, E (size 3). Right of P is F, R, G (size 3).
Step 3: Split remaining Pre-order (Q, S, E, R, F, G) into Left Pre-order (Q, S, E) and Right Pre-order (R, F, G).
Step 4: Left subtree: Pre (Q, S, E), In (S, Q, E). Root is Q. Left In is S, Right In is E. So Q has left child S, right child E.
Step 5: Right subtree: Pre (R, F, G), In (F, R, G). Root is R. Left In is F, Right In is G. So R has left child F, right child G.
Step 6: Evaluate options.
A) P is root. (True)
B) Post-order is Left Post + Right Post + Root. Left Post: S, E, Q. Right Post: F, G, R. Total: S, E, Q, F, G, R, P. (True)
C) Q has two children (S and E). (False)
D) G is in the right subtree of R. (False)