Open In App
Related Articles

GATE | GATE-CS-2007 | Question 43

Improve
Improve
Improve
Like Article
Like
Save Article
Save
Report issue
Report
A complete n-ary tree is a tree in which each node has n children or no children. Let I be the number of internal nodes and L be the number of leaves in a complete n-ary tree. If L = 41, and I = 10, what is the value of n? (A) 3 (B) 4 (C) 5 (D) 6

Answer: (C)

Explanation:
L=(K-1)*I+1

L=41

I=10

K=?

L=(K-1)*I+1

41=(k-1)*10+1

(k-1)*10=40

k-1=4

k=5 
See question 3 of https://www.geeksforgeeks.org/data-structures-and-algorithms-set-11/

Quiz of this Question

Last Updated : 31 Aug, 2021
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads