Skip to content
Related Articles

Related Articles

Improve Article

GATE | GATE CS 2010 | Question 65

  • Difficulty Level : Medium
  • Last Updated : 28 Jun, 2021

In a binary tree with n nodes, every node has an odd number of descendants. Every node is considered to be its own descendant. What is the number of nodes in the tree that have exactly one child?
(A) 0
(B) 1
(C) (n-1)/2
(D) n-1


Answer: (A)

Explanation: It is mentioned that each node has odd number of descendants including node itself, so all nodes must have even number of descendants 0, 2, 4 so on. Which means each node should have either 0 or 2 children. So there will be no node with 1 child. Hence 0 is answer.

Following are few examples.

       a
    /    \
   b      c


      a
    /   \
   b     c  
  /  \
 d    e

Such a binary tree is full binary tree (a binary tree where every node has 0 or 2 children).


Quiz of this Question

Attention reader! Don’t stop learning now.  Practice GATE exam well before the actual exam with the subject-wise and overall quizzes available in GATE Test Series Course.

Learn all GATE CS concepts with Free Live Classes on our youtube channel.

My Personal Notes arrow_drop_up
Recommended Articles
Page :