What is the maximum total number of nodes in a tree that has
N levels? Note that the root is level (zero)
Answer Posted / vaishali naidu
If root is at level 0 then :
Case 0:
When level is 1 max nodes is 1
Case 1:
When level is 1 then max would be 3.
Case 2:
When level is 2 then max nodes would be 7
So formula would be 2^(n+1) -1
2^(0+1)-1=1
2^(1+1)-1=3
2^(2+1)-1=7
| Is This Answer Correct ? | 6 Yes | 3 No |
Post New Answer View All Answers
What is stack and its operations?
What do you mean by spanning tree?
Which is better hashset or treeset?
Why is merge sort faster?
Are linked lists considered linear or non-linear data structure?
In tree construction which is the suitable efficient data structure?
What is map keyset?
What are three common types of traversals?
Does arraylist have a tostring?
What is heap tree?
Which sorting technique is best?
How helpful is abstract data type of data structures?
Is vector a collection?
How to find if linked list has loop?
What is rule regarding overriding equals and hascode method?