HCL
Company
Programming
Definition
in complete tree with 5 level,each node have 4 child or no child ,how many node in the tree,
option
1>321 2>256 3>1024 4>non of these .
Read Solution (Total 12)
-
- 1024 because
when node have 4 child (4^h)-1=(4^5)-1=1023
now when node have 0 child then there will be only 1 node
so 1023+1=1024 - 10 years agoHelpfull: Yes(9) No(1)
- as in binary tree we take (2^h)-1 and for explanation if h=1, number of nodes in binary tree is 1. (i.e true).
But,
in case of 4-ary tree if we take (4^h)-1 and for explanation if h=1, number of nodes in this tree is 3. (i.e false). thats why we cant use this formula.
correct answer is 4^0+4^1+4^2+4^3+4^4 = 341 - 9 years agoHelpfull: Yes(3) No(0)
- 341=1+4+16+64+256
- 10 years agoHelpfull: Yes(2) No(1)
- none of these
337 is correct answer - 10 years agoHelpfull: Yes(1) No(3)
- can any one solve and tell me the answer frnds.......i dnt know how to do.
- 10 years agoHelpfull: Yes(1) No(2)
- 1
- 10 years agoHelpfull: Yes(1) No(0)
- 4) as the correct ans wld b 1365
- 10 years agoHelpfull: Yes(0) No(1)
- plz some one explain the solution of this question
- 10 years agoHelpfull: Yes(0) No(1)
- what is the correct answer...?
- 10 years agoHelpfull: Yes(0) No(0)
- If a binary consists od two child rens and haing heigh h ;then the no of nodes are as we know 2 pow h -1.like here we having 4 Childs.Just apply.SIddarth is right
- 10 years agoHelpfull: Yes(0) No(0)
- ans is d) non of these
levels n=5,each node have 4 child
so
4^(5-1)=4^4
=4^0+4^1+4^2+4^3+4^4
=1+4+16+64+256=341
- 10 years agoHelpfull: Yes(0) No(0)
- 4^5=1024
bcz each level can have 4 or 0 child so total may have (1024+1) including root node - 9 years agoHelpfull: Yes(0) No(0)
HCL Other Question