19 questions · 59 marks · 10 papers. Try each one before checking.
Solve them and check answers →Read the notes first
03 Aug 2025
Question 3 MCQ · 4 marks
If we perform the following operations in the given order on the min-heap [11, 19, 12, 26, 32, 27, 20, 29, 37] then the resulting min-heap would be ___.
1 delete_min()
2 insert(18)
This question has a figure: open the interactive page.
[12, 18, 20, 19, 32, 37, 27, 26, 29]
[12, 18, 20, 19, 32, 27, 37, 29, 26]
[12, 18, 19, 20, 27, 32, 37, 29, 26]
[12, 20, 18, 19, 32, 27, 37, 26, 29]
Question 6 MCQ · 3 marks
Consider the max-heap [71, 46, 27, 37, 29, 17, 11, 32, 36] built by repeated insertion of values into an empty heap. Which of the following could not have been the last element inserted into this heap?
71
36
37
29
July 2022
Question 3 MCQ · 3 marks
A Priority-Queue is implemented as a Min-Heap. Initially, the Min-Heap is [7, 8, 11, 15, 20, 27]. Two new elements 9 and 5 are inserted in the given Min-Heap in that order. Min-Heap after the insertion of the elements is
This question has a figure: open the interactive page.
[5, 7, 8, 9, 20, 27, 11, 15]
[5, 7, 9, 8, 20, 27, 11, 15]
[5, 7, 9, 8, 11, 20, 27, 15]
[5, 7, 8, 9, 11, 15, 20, 27]
Question 10 MSQ · 3 marks
Which of the following statement(s) is/are true?
The smallest element in a max-heap is always at a leaf node
The smallest element in a max-heap is always at the lowest level
The second-largest element in a max-heap is always a child of the root node
Finding a minimum element in max-heap takes $O(\log n)$ time
Insert a new element in max-heap takes $O(\log n)$ time in worst case
01 Dec 2024
Question 15 MSQ · 3 marks
Consider a min-heap with 45 distinct elements implemented using array $A$ with index 0 to 44. The largest element can not be in between
A[11] and A[21] (both inclusive)
A[0] and A[10] (both inclusive)
A[31] and A[44] (both inclusive)
A[22] and A[30] (both inclusive)
06 Apr 2026
Question 12 MSQ · 3 marks
Consider a min-heap implemented using an array with n distinct elements. Which of the following statements about the time complexity of operations on a min-heap is/are true in the worst case?
Inserting a new element into a min-heap can be performed in $O(\log n)$ time.
Finding the second minimum element in a min-heap can be performed in $O(1)$ time.
Finding the maximum element in a min-heap can be performed in $O(\log n)$ time.
Deleting the minimum element from a min-heap can be performed in $O(1)$ time.
Question 3 MCQ · 3 marks
Which of the following correctly represents the final max-heap after inserting elements 1, 2, 3, 5, 7, 6, and 4 in the given order one by one, starting with an empty heap? Note:- Ensure that the max-heap property is maintained after each insertion.
7, 6, 5, 1, 3, 4, 2
7, 5, 6, 1, 2, 3, 4
7, 6, 5, 4, 3, 2, 1
7, 5, 6, 1, 3, 2, 4
Aug 2023
Question 7 MSQ · 3 marks
Which of the following operation can be performed in $O(\log n)$ time on min-heap? Consider the size of min-heap is $n$ and implemented using an array.
Inserting a new element
Deleting the smallest element
Update the value at the known index
Finding the largest element
Question 6 MCQ · 4 marks
Consider a max-heap represented as the following list: [30, 20, 25, 5, 15, 23, 10, 3, 2] What are the leaf nodes of the resultant max-heap after the following operations are done on it?
delete_max()
Insert(24)
This question has a figure: open the interactive page.
2, 3, 5, 10, 15
2, 3, 10, 15, 23
2, 3, 5, 10, 20
2, 3, 5, 10, 23
Dec 2023
Question 4 MCQ · 3 marks
Consider a min-heap represented as the following list:
[3, 6, 27, 65, 45, 33, 29, 72].
What would be the resultant min-heap after the following operations are done on it?
delete_min()
Insert(10)
Insert(5)
This question has a figure: open the interactive page.
[5, 6, 27, 10, 72, 29, 33, 65, 45]
[5, 6, 27, 10, 72, 33, 29, 45, 65]
[5, 6, 27, 72, 10, 33, 29, 45, 65]
[5, 6, 27, 10, 72, 33, 29, 65, 45]
Question 15 MSQ · 3 marks
Which of the following statements is/are true about min-heap with distinct elements:
The largest element in a min-heap is always at a leaf node.
The largest element in a min-heap is always at the lowest level.
The second-smallest element in a min-heap is always a child of the root node.
Finding the largest element in min-heap takes $O(\log n)$ time.
16 Mar 2025
Question 13 MSQ · 3 marks
Which of the following arrays represent a valid min-heap when implemented as a 0-indexed array?
[1, 3, 6, 5, 4, 9, 8, 7]
[2, 4, 3, 8, 10, 15, 9, 6]
[7, 10, 15, 20, 30, 16, 12, 22]
[3, 6, 8, 10, 15, 9, 11, 20]
Question 14 SA · 3 marks
A binary heap is implemented using a 0-indexed array. The heap currently contains 100 elements. What is the index of the right child of the node at index 35?
Type your answer on the interactive page.
24 Mar 2024
Question 4 MCQ · 3 marks
You have a max-heap with the following set of elements: $\{10, 5, 15, 3, 8, 12\}$ Which of the following elements is guaranteed to be a child of the element 15?
10
5
12
8
04 Aug 2024
Question 6 MCQ · 3 marks
If we perform the following operations in the given order on the min-heap [1, 7, 13, 11, 9, 16, 21, 26, 19] then the resulting min-heap would be ___.
1 delete_min()
2 insert(6)
This question has a figure: open the interactive page.
[6, 7, 13, 9, 19, 16, 21, 26, 11]
[6, 7, 13, 9, 19, 16, 21, 11, 26]
[6, 7, 13, 9, 19, 21, 16, 26, 11]
[6, 7, 13, 9, 19, 21, 16, 11, 26]
Question 15 MSQ · 3 marks
Which of the following statements is/are true for Heap sort?
The complexity of Heap sort is $O(n \log n)$ irrespective of the sequence of elements.
The complexity of Heap sort is $O(n^2)$ in worst case and $O(n \log n)$ in best case.
Heap Sort is an in-place sorting algorithm.
Heap Sort is not a stable sorting algorithm because it does not maintain the relative order of equal elements.
Question 13 SA · 3 marks
What is the minimum number of elements possible in a binary heap with a height of 9? Consider the height of the empty binary heap is 0.
Type your answer on the interactive page.
14 Aug 2026
Question 4 MCQ · 3 marks
Consider a min-heap represented as the following list:
[2, 5, 10, 15, 7, 20, 25, 18, 19]
What are the leaf nodes of the resultant min-heap after the following operations are done on it?
delete_min()
insert(6)
This question has a figure: open the interactive page.
18, 15, 19, 20, 25
7, 18, 19, 20, 25
6, 18, 19, 20, 25
15, 18, 19, 7, 25
Question 5 MCQ · 3 marks
A standard max-heap contains $n$ elements. What is the worst-case time complexity of the most efficient algorithm for finding the minimum element in a standard max-heap?
$O(1)$
$O(\log n)$
$O(n)$
$O(n \log n)$
Check your answers →
Other PDSA topics