GATE Computer ScienceEasyGATE CS (PYQ pattern)

A rooted tree has 6 nodes with 2 children, 5 nodes with 3 children and 4 nodes with 4 children; every other node is a leaf. How many nodes does the tree have in all?

  1. A. 43
  2. B. 45
  3. C. 35
  4. D. 44

Correct answer: D. 44

Edges = total children = 12 + 15 + 16 = 43, and nodes = edges + 1 = 44, matching leaves 29 plus internal 15.

More Programming and Data Structures (GATE) questions

Exams that ask this topic