Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

Answers were Sorted based on User's Feedback



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

Answer / mahfooz

2^N-1

because root is at level 0. and there are n levels only.
so last level i.e level of leaves should be n-1. for maximum
we will consider complete binary tree which is full at level
n-1.

for 0 level -> 2^0 i.e 1 element
for 1 level -> 2^1
...
so on

for n-1 levle ->2^(n-1) nodes
---------------------------
sum = 2^n-1

Is This Answer Correct ?    2 Yes 2 No

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

Answer / uday

he didnt mention type of tree as binary tree so answer for
at 0level is 1, for other levels max is infinate

Is This Answer Correct ?    0 Yes 0 No

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

Answer / saravana perumal

2pown-1

Is This Answer Correct ?    0 Yes 0 No

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

Answer / ubukkak

2^n - 1 is only binary tree
so
n! is number of tree with n node

Is This Answer Correct ?    0 Yes 0 No

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

Answer / m.eshwar

if the tree is binary tree [i.e two children max]then
2pow(N) is the answer
if it has 3 max children then
3pow(N)
...............................
if it has n max children then
npow(N)

Is This Answer Correct ?    4 Yes 7 No

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

Answer / pavan

2powN-1

Is This Answer Correct ?    9 Yes 19 No

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

Answer / prachi

2^N-1

Is This Answer Correct ?    2 Yes 14 No

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

Answer / srikanth

(n)2-1

Is This Answer Correct ?    11 Yes 34 No

Post New Answer

More Data Structures Interview Questions

Explain linked list in short.

0 Answers  


What are data structures in programming?

0 Answers  


Define quadratic probing?

0 Answers  


Define collision in hashing?

0 Answers  


Can we add duplicate keys in a hashmap? What will happen if we attempt to add duplicate values?

0 Answers  


What is lifo?

3 Answers  


Can we modify final arraylist?

0 Answers  


Why is arraylist used?

0 Answers  


What is collision in data structure?

0 Answers  


What is significance of ” * ” ?

0 Answers  


What is the space complexity of bubble sort?

0 Answers  


What is binary tree and its types?

0 Answers  


Categories