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


Please Help Members By Posting Answers For Below Questions

What are the basic operations of stack?

469


Which are the sorted collections?

549


How does a treemap sort?

423


Why null is not allowed in treemap?

492


Can arraylist have null values?

464






Explain the uses of b+ tree.

529


Does linkedhashset allow duplicates?

418


What is two-dimensional array?

518


What is the height of binary tree?

497


Is hashmap sorted?

510


What is meant by heap sort?

491


What is a class user?

556


What is the meaning of anonymous array? Explain with an example?

740


What is difference between arraylist and linkedlist?

541


Explain Linked List

562