recategorized by
1,338 views
3 votes
3 votes

The number of nodes in height h in any n-element heap is

  1. $h$
  2. $z^h$
  3. ceil $\biggl(\frac{n}{z^h} \biggr)$
  4. ceil $\biggl(\frac{n}{z^{h+1}} \biggr)$
recategorized by

2 Answers

2 votes
2 votes

question is ambiguous  Z is unspecified here if we consider it 2 then e.g if we consider a heap of element 7 (complete binary tree with height h) then nodes at height h will be 4 .

At height h the no of nodes may vary from 1 to 2^h  

now if we consider Root as node of height H then it will always be 1  and option D gives this ans

as ceil(n/2^h+1) will be upgraded to 1 

Answer:

Related questions

3 votes
3 votes
2 answers
1
go_editor asked Aug 1, 2016
5,899 views
Consider a hash table of size m=100 and the hash function h(k)=floor (m(kA mod 1)) for $A=\frac{ (\sqrt{5}-1)}{2} = 0.618033$. Compute the location to which the key k=123...
2 votes
2 votes
1 answer
3
3 votes
3 votes
1 answer
4
go_editor asked Aug 2, 2016
2,558 views
Match the following for UNIX system calls :$\begin{array}{clcl} &\textbf{List-I} && \textbf{List-II} \\ \text{(a)} & \text{exec} & \text{(i)} & \text{Creates new process...