GATE Computer ScienceEasyGATE CS (PYQ pattern)

A binary tree with 25 nodes has two pointer fields per node. How many of these 50 fields hold NULL, and how many hold NULL if the tree is a full binary tree (every node has 0 or 2 children) with 25 nodes?

  1. A. 26 and 13
  2. B. 25 and 26
  3. C. 26 and 26
  4. D. 24 and 24

Correct answer: C. 26 and 26

Every non-root node is the target of exactly one pointer, so 24 fields are non-NULL and 50 - 24 = 26 are NULL whatever the shape; a full tree with 25 nodes is no exception (13 leaves, 26 NULL fields).

More Programming and Data Structures (GATE) questions

Exams that ask this topic