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
Which of the collections allows null as the key?
Explain the Queue
What is a height of a tree?
What is the difference between classifying and sorting?
What is arrays copyof?
Which is more efficient merge sort vs quicksort?
Explain what is the type of the algorithm used in solving the 8 queens problem?
What are the properties of binary tree?
Why do we need linked lists?
What are the different types of data structures?
Why is tuple immutable?
Write a recursive c function to calculate the height of a binary tree.
How do you insert a new item in a binary search tree?
Can an arraylist be null?
What do you mean by rehashing?