If we implement heap as min-heap , deleting root node (value 1)from the heap. What would be the value of root node after second iteration if leaf node (value 100) is chosen to replace the root at start.
Correct Answer: A
None.
report Report Error
Select Issue Type
Selected Issue
forum Community Discussion
speaker_notes_off
No discussions yet. Be the first to start!
syncLoading more...
You must be logged in to participate in the discussion.
For construction of a binary heap with property that parent node has value less than child node.In reference to that which line is incorrect. Line indexed from 1.
What will be the order of new heap created after union of heap H1 and H2 when created by the following code. Initially both are of the order n.
FIB_UNION(H1,H2)
{
H =MAKE_HEAP()
min[H]= min[H1]
concatenate the root list of H2 with the root list of H
if (min[H1] = NIL) or (min[H2]!= NIL and min[H2] < min[H1])
then min[H] = min[H2]
n[H]= n[H1] + n[H2]
free the objects H1 and H2
return H
}