GATE DA 2026 | Question 25

Programming, Data Structures and Algorithms › Trees · MSQ · 1 mark · Answer: A, B

  1. Question 25Programming, Data Structures and Algorithmsmsq1 mark
    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 G
    In-order:  S Q E P F R G
    Which of the following statements is/are true about the Binary Tree T?
    • A.
      Node P is the root of T
      ✓
    • B.
      The Post-order traversal of T is: S E Q F G R P
      ✓
    • C.
      Node Q has only one child
    • D.
      The left subtree of node R contains the node G

    Answer: A, B

    Solution

    The first pre-order element, P, is the root. In the in-order sequence, S Q E lies to the left of P and F R G to the right. - Left part: next in pre-order is Q, so Q is the root with S on the left and E on the right. - Right part: next is R, so R is the root with F on the left and G on the right.
            P
          /   \
         Q     R
        / \   / \
       S   E F   G
    - (A) P is the root. True. - (B) Post-order (left, right, root): S E Q F G R P. True. - (C) Q has two children. False. - (D) G is the right child of R. False. Answer: (A), (B).

Attempt GATE DA 2026 in real GATE exam mode

Full paper with a timer, the GATE interface and a topic-wise analysis — free.

Create free account →