Recent questions tagged binary-heap

7 votes
2 answers
181
Match the following and choose the correct answer in the order $A, B,C$$\begin{array}{|ll|ll|} \hline \text{A.} & \text{Heap Construction} & \text{p.} & O(n\log n) \\\hli...
1 votes
1 answer
182
For searching an element from heap,then delete it from heapWhy will it take O(n+log n) time and not O(n log n) time?
7 votes
2 answers
183
0 votes
1 answer
184
to find the maximum elements in a min heap represnted by an array can be computed in ____________ timea. theta nb.theta n2c.theta nlognd.theta 1
2 votes
0 answers
185
Show that there are at most (n/2^h+1) nodes of height h in any n-element heap.
2 votes
0 answers
186
Show that the worst case time complexity of MAX_HEAPIFY is Ω(logn ) .
0 votes
1 answer
189
Why do we want the loop index i in Line 2 of BUILD_MAX_HEAP to decrease from ceil(A.length/2) to 1 rather than increase from 1 to ceil(A.length/2) ?
1 votes
1 answer
190
The number of min heap trees are possible with 15 elements such that every leaf node must be greater than all non-leaf nodes of the tree are ________.
2 votes
3 answers
191
The number of ways in which the numbers 1, 2, 3, 4, 5 can be inserted into binary heap. Such that resulted binary heap is max heap ________.
1 votes
1 answer
192
To find the kth smallest element in the heap , the time required is O(n), where k is less than the number of element in the heap. is this statement true should not it be ...
1 votes
1 answer
193
Heap allocation is required for languages thatUse dynamic scope rulesSupport dynamic data structuresSupport recursionSupport recursion and dynamic data structures
6 votes
2 answers
194
In a min-heap, the next largest element of a particular element can be found in ___ time.A) O(1)B) O(log n)C) O(n)
0 votes
1 answer
196
time taken to delete a node from min heap if you know the value but not positionTo find the position of the number in min heap should not be log(n)why is it so O(n)
0 votes
2 answers
197
2 votes
0 answers
203
Number of node of height h in a binary tree is given as ceiling (n/2^(h+1)) from where this formula come ? I've only found proof by induction or solving for a particular ...
0 votes
1 answer
208
0 votes
2 answers
209
I. A heap is always nearly complete tree.II. Worst case complexity of heapify operation is O( log n)III. Worst case complexity of build heap operation is O( n log n)a. I ...
6 votes
1 answer
210
A binary min-heap contains keys 1,2,3,4.....2047,2048What is smallest key that can be at leaf node.??