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

Define non-linear data structures?

566


Two linked lists are given, find out the sum of them without altering the linked list?

560


Can you sort a hashset?

527


What is the use of threaded binary tree?

571


What is sorting and its types?

519






What are splay trees?

579


How would you swap the Kth node from beginning with Kth node from end in a Linked List.

565


Can you tell me the differences between Array and ArrayList?

602


Is heap sort faster than quicksort?

474


How can I study data structures and algorithms?

519


What are control structures?

536


Why do we use stacks?

474


Is arraylist reference type?

465


How to find the duplicate in an array?

543


What is the use of tree data structure?

480