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 basic algorithms?

459


How is the front of the queue calculated in data structure?

441


How to search binary in a sorted array?

501


How many types of priority queue are there?

499


How to excel in data structures and algorithms?

543






What are AVL trees?

583


What is the difference between array and stack?

546


What are the tasks performed during inorder traversal?

560


Write an algorithm to show various operations on ordered list and arrays

515


What is immutablelist?

489


What do you understand by doubly linked list?

510


What are the standard ways in which a graph can be traversed?

490


Why is merge sort faster?

498


Which sorting algorithm has minimum number of swaps?

517


Why quicksort is faster than merge sort?

492