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
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 |
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 |
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 |
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 |
Can we change the size of an array at run time?
Write any two principles of gradation of structures.
0 Answers Mahatma Gandhi University,
Can we insert null in set?
Will this code give error if I try to add two heterogeneous elements in the arraylist? And why?
Can an arraylist be null?
What is meant by deque?
What is the maximum size of array?
What data structure would you mostly likely see in a non recursive implementation of a recursive algorithm?
What are the applications of stack?
Tell me what should be done in the base case for this recursive problem?
What are the types of linked list?
what is Singly Linked list?