What is the maximum total number of nodes in a tree that has
N levels? Note that the root is level (zero)
Answer Posted / 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 |
Post New Answer View All Answers
Is hashset synchronized?
Describe what is Node in link list? And name the types of Linked Lists?
What are the major data structures used in the rdbms?
What is the difference between static and dynamic data?
What does sorting an array do?
How many types of data structures are there?
What is the use of space complexity and time complexity?
What is quick sort?
What does bubble sort do?
Can you dynamically allocate arrays in expanded memory?
What is the complexity of adding an element to the heap?
What is the use of treemap?
What are the issues that hamper the efficiency in sorting a file?
How does a hashmap work?
Write an algorithm to show various operations on ordered list and arrays