Select an option to see the answer and solution.
Heaps
practice.
Practice every MCQ with options. Use Show answers when you want the correct option and solution.
166
Questions
5/9
Page
Pick an option on a question to see the right answer and solution.
mergeTree(p,q)
if p.root.value <= q.root.value
return p.addTree(q)
else
return q.addTree(p)Select an option to see the answer and solution.
Select an option to see the answer and solution.
Select an option to see the answer and solution.
build(A,i)
left-> 2*i
right->2*i +1
temp- > i
if(left<= heap_length[A] ans A[left] >A[temp])
temp -> left
if (right = heap_length[A] and A[right] > A[temp])
temp->right
if temp!= i
swap(A[i],A[temp])
build(A,temp)Select an option to see the answer and solution.
Select an option to see the answer and solution.

Select an option to see the answer and solution.
Select an option to see the answer and solution.
Select an option to see the answer and solution.
Select an option to see the answer and solution.
Select an option to see the answer and solution.
Select an option to see the answer and solution.
Select an option to see the answer and solution.
int myfun(heap_arr[])
{
int mini=INF;
for(int i=0;i<tot_node;i++)
mini=min(mini,heap_arr)
return mini;
}Select an option to see the answer and solution.
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. }Select an option to see the answer and solution.
Select an option to see the answer and solution.
Select an option to see the answer and solution.
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] + 1Select an option to see the answer and solution.
insert(int n)
{
if(buffer_size()< maxi_biffer_size())
buffer_aar[ind]==n;
else
move_to_heap(buffer,buffer+maxi_buffer_size())
}Select an option to see the answer and solution.
Q100
Open questionSelect an option to see the answer and solution.