The GATE Grind

GATE Programming and Data Structures: Binary Heaps – Previous Year Questions

11 GATE previous year questions on Binary Heaps (Programming and Data Structures, Computer Science) with answers and explanations, from every paper.

  1. GATE 2016 CS Q47 (2 marks, Multiple choice) – An operator `delete(i)` for a binary heap data structure is to be designed to delete the item in the i-th node. Assume that the heap is implemented in…
  2. GATE 2015 CS Q37 (2 marks, Multiple choice) – Consider a max heap, represented by the array: 40, 30, 20, 10, 15, 16, 17, 8, 4. Array Index 1 2 3 4 5 6 7 8 9 --- --- --- --- --- --- --- --- --- ---…
  3. GATE 2018 CS Q56 (2 marks, Numerical answer) – The number of possible min-heaps containing each value from \1,2,3,4,5,6,7\ exactly once is .
  4. GATE 2026 CS (CS1) Q23 (1 mark, Multiple select) – Let n be an odd number greater than 100. Consider a binary minheap with n elements stored in an array P whose index starts from 1. Which of the…
  5. GATE 2025 CS (CS1) Q35 (1 mark, Numerical answer) – The height of any rooted tree is defined as the maximum number of edges in the path from the root node to any leaf node. Suppose a Min-Heap T stores…
  6. GATE 2024 CS (CS1) Q41 (2 marks, Multiple choice) – An array [82, 101, 90, 11, 111, 75, 33, 131, 44, 93] is heapified. Which one of the following options represents the first three elements in the…
  7. GATE 2024 CS (CS1) Q43 (2 marks, Multiple choice) – Consider a binary min-heap containing 105 distinct elements. Let k be the index (in the underlying array) of the maximum element stored in the heap.…
  8. GATE 2023 CS Q12 (1 mark, Multiple choice) – Which one of the following sequences when stored in an array at locations A[1],...,A[10] forms a max-heap?
  9. GATE 2023 CS Q46 (2 marks, Multiple choice) – Let A be a priority queue for maintaining a set of elements. Suppose A is implemented using a max-heap data structure. The operation Extract-Max(A)…
  10. GATE 2022 CS Q28 (1 mark, Numerical answer) – Suppose a binary search tree with 1000 distinct elements is also a complete binary tree. The tree is stored using the array representation of binary…
  11. GATE 2020 CS Q57 (2 marks, Numerical answer) – Consider the array representation of a binary min-heap containing 1023 elements. The minimum number of comparisons required to find the maximum in the…