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
Define non-linear data structures?
Two linked lists are given, find out the sum of them without altering the linked list?
Can you sort a hashset?
What is the use of threaded binary tree?
What is sorting and its types?
What are splay trees?
How would you swap the Kth node from beginning with Kth node from end in a Linked List.
Can you tell me the differences between Array and ArrayList?
Is heap sort faster than quicksort?
How can I study data structures and algorithms?
What are control structures?
Why do we use stacks?
Is arraylist reference type?
How to find the duplicate in an array?
What is the use of tree data structure?