Vidyalelo
Data Structure · all questions

Heaps
practice.

Practice every MCQ with options. Use Show answers when you want the correct option and solution.

166

Questions

4/9

Page

Pick an option on a question to see the right answer and solution.

Min heap can be used to implement selection sort.

Select an option to see the answer and solution.

What would be the result if the left subtree of the root has a null path length of 1 and the right subtree has a null path length of 2?

Select an option to see the answer and solution.

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
}

Select an option to see the answer and solution.

What is the complexity of adding an element to the heap.

Select an option to see the answer and solution.

Is decrease priority operation performed more quickly in a ternary heap with respect to the binary heap.

Select an option to see the answer and solution.

Do ternary heap have better memory cache behavior than binary heap.

Select an option to see the answer and solution.

d-heap is similar to that of a?

Select an option to see the answer and solution.

What is the fundamental operation on leftist heap?

Select an option to see the answer and solution.

What is the smallest element of the given minimum ternary heap?
Heaps mcq question image

Select an option to see the answer and solution.

State the complexity of algorithm given below.
int function(vector<int> arr)
int len=arr.length();
if(len==0)
return;
temp=arr[len-1];
arr.pop_back();
return temp;

Select an option to see the answer and solution.

What is the process of building a ternary heap called?

Select an option to see the answer and solution.

Which operation is not efficiently performed in a d-heap?

Select an option to see the answer and solution.

In a binary min heap containing n elements, the largest element can be found in . . . . . . . . time.

Select an option to see the answer and solution.

What is the worst case time in searching minimum value in weak -heap?

Select an option to see the answer and solution.

Pairing heaps time complexity was inspired by that of?

Select an option to see the answer and solution.

What is the time complexity for inserting a new item in a ternary heap of n elements?

Select an option to see the answer and solution.

What will be the position of 5, when a max heap is constructed on the input elements 5, 70, 45, 7, 12, 15, 13, 65, 30, 25?

Select an option to see the answer and solution.

What are the siblings of smallest element of the given maximum ternary heap?
Heaps mcq question image

Select an option to see the answer and solution.

What is the time complexity for decreasing priority of key in a minimum ternary heap of n elements?

Select an option to see the answer and solution.

Choose the correct properties of weak-heap.

Select an option to see the answer and solution.