in Programming
1,115 views
0 votes
0 votes
In a binary tree with n nodes every node has an odd no. of descendants. Every node is considered to be its own descendant. What is the no. of nodes in the tree that has exactly one child?

(a) 0

(b) 1

(c) (n-1)/ 2

(d) n-1
in Programming
1.1k views

1 comment

Mr. @Umang can you please explain this with full tree of 5 nodes???????
0
0

1 Answer

1 vote
1 vote
Best answer
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.

4 Comments

every node has odd number of descendants including the node itself or excluding ??
0
0
including.
0
0
What is the meaning of Descendant.Please Elaborate.
0
0
Mr. @Umang can you please explain this with full tree of 5 nodes???????
0
0

Related questions