Recent questions tagged binary-heap

0 votes
0 answers
92
0 votes
0 answers
93
Why do we want the loop index $i$ in line $2$ of BUILD-MAX-HEAP to decrease from $\lfloor A.length/2 \rfloor$ to 1 rather than increase from 1 to $\lfloor A.length/2 \rfl...
0 votes
0 answers
94
0 votes
0 answers
98
0 votes
1 answer
101
How in a heap there are at most $\lceil \frac{n}{2^{h+1}} \rceil$ nodes of height h.
0 votes
1 answer
103
3 votes
4 answers
104
What is the time complexity to delete an arbitrary node from binary heap?O(n)O(log n)O(1)O(n log n)
1 votes
0 answers
105
Show that, with the array representation for storing an $n$-element heap, the leaves are the nodes indexed by $\lfloor n/2\rfloor +1$,$\lfloor n/2\rfloor +2,…,n$
0 votes
2 answers
106
3 votes
4 answers
108
0 votes
0 answers
109
0 votes
1 answer
111
2 votes
1 answer
114
I was going through the heap concept and one question came into my mind what will be the best case time complexity of finding the minimum element in a max heap?Thank you:...
2 votes
0 answers
115
0 votes
1 answer
116
Consider the following array of elements$<70, 23, 60, 19, 13, 16, 1, 4, 8, 12, 7, 10, 85>$The minimum number of interchanges needed to convert into a max-heap is $4$$1$$3...
0 votes
1 answer
117
Match all items in $\text{Group 1}$ with the $\textbf{best}$ match from the options given in $\text{Group 2}.$$$\begin{array}{|l|l|} \hline \qquad \quad \textbf{Group 1} ...