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
How does variable declaration affect memory allocation?
What is data structure what is need of it?
Write a code for dynamic allocation of array.
List the limitations of linear probing?
What is collections singletonlist?
Differentiate between file and structure storage structure.
How many types of data structure are there?
“int a[] = new int[3]{1, 2, 3}” – This a legal way of defining the arrays?
What are the advantage of linked list over array?
Is there any difference between int[] a and int a[]?
What are the different types of data structures?
Can arraylist store int?
Describe binary tree and its property.
Why is selection sort used?
What is the need for path compression?