91. Time taken in decreasing the node value in a binomial heap is
92. Out of the following given options, which is the fastest algorithm?
93. In a max-heap, element with the greatest key is always in the which node?
94. What does this pseudo_code return?
int myfun(heap_arr[])
{
int mini=INF;
for(int i=0;i<tot_node;i++)
mini=min(mini,heap_arr)
return mini;
}
int myfun(heap_arr[])
{
int mini=INF;
for(int i=0;i<tot_node;i++)
mini=min(mini,heap_arr)
return mini;
}
95. 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.
1. add(int k)
2. {
3. heap_size++;
4. int i = heap_size - 1;
5. harr[i] = k;
6. while (i != 0 && harr[parent(i)] < harr[i])
7. {
8. swap(&harr[i], &harr[parent(i)]);
9. i = parent(i);
10. }
11. }
1. add(int k)
2. {
3. heap_size++;
4. int i = heap_size - 1;
5. harr[i] = k;
6. while (i != 0 && harr[parent(i)] < harr[i])
7. {
8. swap(&harr[i], &harr[parent(i)]);
9. i = parent(i);
10. }
11. }
96. Descending priority queue can be implemented using . . . . . . . .
97. How many nodes does a leftist tree with r nodes must have?
98. What is wrong with the following code of insertion in fibonacci heap.
Choose the correct option
FIB-INSERT(H, x)
degree[x]= 0
p[x]= NIL
child[x] =NIL
left[x] =x
right[x] =x
mark[x] =FALSE
concatenate the root list containing x with root list H
if min[H] = NIL or key[x] > key[min[H]]
then min[H]= x
n[H]= n[H] + 1
Choose the correct option
FIB-INSERT(H, x)
degree[x]= 0
p[x]= NIL
child[x] =NIL
left[x] =x
right[x] =x
mark[x] =FALSE
concatenate the root list containing x with root list H
if min[H] = NIL or key[x] > key[min[H]]
then min[H]= x
n[H]= n[H] + 1
99. What is the complexity of given function of insertion.
insert(int n)
{
if(buffer_size()< maxi_biffer_size())
buffer_aar[ind]==n;
else
move_to_heap(buffer,buffer+maxi_buffer_size())
}
insert(int n)
{
if(buffer_size()< maxi_biffer_size())
buffer_aar[ind]==n;
else
move_to_heap(buffer,buffer+maxi_buffer_size())
}
100. In skew heaps, certain constraints are to be met in order to perform swapping.
Read More Section(Heaps)
Each Section contains maximum 100 MCQs question on Heaps. To get more questions visit other sections.