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

2/9

Page

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

In a binary heap, what is the typical time complexity of deleting an arbitrary element?

Select an option to see the answer and solution.

What is the primary use of heaps in graph algorithms?

Select an option to see the answer and solution.

How is the parent node index computed in a zero-based indexed binary heap array?

Select an option to see the answer and solution.

What happens if you increase the value of a node in a max-heap?

Select an option to see the answer and solution.

Which of the following operations is not directly supported by a binary heap?

Select an option to see the answer and solution.

In a binary heap represented as an array, what is the index of the left child of the node at index i?

Select an option to see the answer and solution.

What is the space complexity of a binary heap when stored in an array?

Select an option to see the answer and solution.

Which operation involves moving a node to maintain the heap property after insertion in a binary heap?

Select an option to see the answer and solution.

In a max-heap, what is the time complexity to find the second largest element?

Select an option to see the answer and solution.

What kind of binary heap is used to efficiently support priority queues with the smallest element at the root?

Select an option to see the answer and solution.

What is the result of an inorder traversal of a binary heap?

Select an option to see the answer and solution.

Which of the following is not a type of heap?

Select an option to see the answer and solution.

What is the time complexity of building a binary heap using a sequence of insertions?

Select an option to see the answer and solution.

What is the typical use case for a min-heap in algorithms?

Select an option to see the answer and solution.

In a binary heap, how do you locate the right child of a node at index i?

Select an option to see the answer and solution.

Which property is common to both max-heaps and min-heaps?

Select an option to see the answer and solution.

What is the typical time complexity of decreasing a key in a min-heap?

Select an option to see the answer and solution.

How is the structure of a binary heap affected when you increase the size of the heap?

Select an option to see the answer and solution.

In a binary heap stored as an array, what is the index of the parent node for the node at index i?

Select an option to see the answer and solution.

What is the time complexity of extracting the minimum element from a min-heap?

Select an option to see the answer and solution.