What is the maximum total number of nodes in a tree that has
N levels? Note that the root is level (zero)

Answer Posted / vaishali naidu

If root is at level 0 then :
Case 0:
When level is 1 max nodes is 1
Case 1:
When level is 1 then max would be 3.
Case 2:
When level is 2 then max nodes would be 7

So formula would be 2^(n+1) -1

2^(0+1)-1=1
2^(1+1)-1=3
2^(2+1)-1=7

Is This Answer Correct ?    6 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What happens in insertion sort?

485


What are the advantages and disadvantages of linked list over array?

467


What is basic data structure?

503


Which searching algorithm is best?

460


Explain binary tree traversals?

501






Is binary tree a binary search tree?

475


What are the tasks performed during preorder traversal?

609


How do you declare A pointer to array of three chars

525


What is a pass in bubble sort?

481


What is a reverse linked list.

588


How do you reference all the elements in a one-dimension array?

584


Evaluate the following prefix expression " ++ 26 + - 1324" (Similar types can be asked)

570


What are the disadvantages of using collection classes over arrays?

514


Mention a few applications of linked lists?

485


How does quicksort partition work?

527