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

How do you find the height of a binary tree?

486


Why is sorting necessary?

484


Which language is best for data structures and algorithms?

504


What are the types of array operations?

503


Which sorting is best?

489






Which file contains the definition of member functions?

510


Program to remove duplicate elements in an array.

532


Describe what is Node in link list? And name the types of Linked Lists?

540


What is sort order?

494


What is the best case complexity of quicksort?

518


what is Singly Linked list?

582


What do you mean by the term “percolate up”?

552


What are the Advantages and disadvantages of Array?

600


How do you balance a tree?

515


What is the difference between hashmap and arraylist?

528