GATE CS 1996 · Arrays & Matrix Representation

MCQ · 1 mark · Problem PROG-DSTR-0263

Consider the binary tree with root a. The root's left child is b and its right child is e. Node b has left child c and right child d. Node c has only a left child, g. Node e has only a left child, f. Nodes d, g and f are leaves.Which of the following sequences denotes the postorder traversal sequence of this tree?
  1. A
    fegcdba
  2. B
    gcbdafe
  3. C
    gcdbfea
  4. D
    fedgcba

Solve it on GATE DA practice →More Basic Data Structures problems

Show the worked solution\[\boxed{\text{postorder} = \text{left subtree},\ \text{right subtree},\ \text{root}}\]Subtree of c: g c. Subtree of b: (g c) d b.Subtree of e: f e.Whole tree: (g c d b) (f e) a = gcdbfea.Answer: C

GATE DA practice: past exam problems by chapter, with worked solutions · gatedaprep.com