What is the maximum total number of nodes in a tree that has
N levels? Note that the root is level (zero)
Answer Posted / gaurav gupta
(2^(N+1))-1
Suppose level is 2 then total number of nodes will be
1 root
2 left of root and right of root
2 left and right of left of root
2 left and right of right of root
so total nodes are 1+2+2+2=7
by formula (2^(2+1))-1
8-1=7
| Is This Answer Correct ? | 24 Yes | 10 No |
Post New Answer View All Answers
Define primary data structures?
Explain Array of pointers?
What are the 4 types of data?
Does treemap allow null values?
What are the basic data structures?
What is unbounded queue?
How long does it take to master data structures and algorithms?
How are the elements of a 2d array are stored in the memory?
You are given a singly linked list. How would you find out if it contains a loop or not without using temporary space?
Which is better hashmap or treemap?
What are the advantages of linked list over an array?
How do you initialize an arraylist?
Run time memory allocation is known as ?
Which collection is used for sort?
Differentiate between compilers and interpreters.