Master Mathematics.

Programming · Hard · Data Structures · Problem 2

Rebuilding a tree from preorder and inorder

A binary tree on nodes has preorder P Q S E R F G and inorder S Q E P F R G. Which statements are true?

  1. (A) Node P is the root of T
  2. (B) The post-order traversal of T is S E Q F G R P
  3. (C) Node Q has only one child
  4. (D) The left subtree of node R contains the node G

Source: GATE DA