DATA STRUCTURE
Programming and Technical
Programming
Technical
What is the maximum total number of nodes in a tree that
has N levels? Note that the root is level (zero)
Read Solution (Total 6)
-
- hey the right answer is 2^(n+1)-1 for example if the level is 2 from zero then max nodes used are 7 =2^(2+1)-1
- 10 years agoHelpfull: Yes(7) No(0)
- (2 pow n)-1,if root level is one and (2 pow n+1)-1, if root
level is zero. - 7 years agoHelpfull: Yes(3) No(0)
- 2^n
max no. of nodes at level i is 2^(i-1)
so here total levels are n+1 - 10 years agoHelpfull: Yes(1) No(0)
- n nodes bec level =hight +1
- 10 years agoHelpfull: Yes(0) No(0)
- nodes=2^n-1
where n is no of nodes - 10 years agoHelpfull: Yes(0) No(0)
- hey the right answer is 2^(n)-1 .
- 6 years agoHelpfull: Yes(0) No(2)
DATA STRUCTURE Other Question