What is the maximum total number of nodes in a tree that has
N levels? Note that the root is level (zero)
Answer Posted / mahfooz
2^N-1
because root is at level 0. and there are n levels only.
so last level i.e level of leaves should be n-1. for maximum
we will consider complete binary tree which is full at level
n-1.
for 0 level -> 2^0 i.e 1 element
for 1 level -> 2^1
...
so on
for n-1 levle ->2^(n-1) nodes
---------------------------
sum = 2^n-1
| Is This Answer Correct ? | 2 Yes | 2 No |
Post New Answer View All Answers
What is precision?
Is arraylist fail fast?
Is hashmap ordered?
What do you mean by external sorting?
Are linked lists useful?
What do you mean by collision in hashing?
What is the types of data structure?
Can we add heterogeneous elements into treemap?
Define static data structures?
What are the disadvantages array implementations of linked list?
How many types of sorting algorithms are there?
Differentiate bfs and dfs?
What is difference between capacity and size of arraylist?
Is vector a collection?
Why sorting is done?