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
Is learning data structures necessary?
What is an acyclic graph?
What are the differences between b tree and b+ tree?
do records fall under linear or non linear data structures?
Is array a collection?
What is entryset in hashmap?
What do you know about different sorting algorithms?
Define the graph data structure?
What exactly is a thread?
How does max heap work?
Difference between calloc and malloc in data structures?
How many sorting are there in data structure?
Can we null keys in treemap?
What is definition list?
Is quicksort a stable algorithm?