Skip to content

GATE CS Binary Heaps questions

Practise Binary Heaps questions for GATE CS. Explore official PYQs and original topic-wise quizzes, check answers and view available solutions. Free, no sign-in.

Subject, topic, year and type filter the full library. Match any choice within a filter, and all selected filter categories. Search, source and sort apply to this page.

20 on this page
Official PYQ2025Programming and Data StructuresBinary HeapsNAT · 1 mark
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\text{T} stores 3232 keys. The height of T\text{T} is ___________. (Answer in integer)
Official PYQ2024Programming and Data StructuresBinary HeapsMCQ · 2 marks
Consider a binary min-heap containing 105105 distinct elements. Let kk be the index (in the underlying array) of the maximum element stored in the heap. The number of possible values of kk is
Official PYQ2023Programming and Data StructuresBinary HeapsMCQ · 1 mark
Which one of the following sequences when stored in an array at locations A[1],…,A[10]A[1], \ldots, A[10] forms a max-heap?
Official PYQ2023Programming and Data StructuresBinary HeapsMCQ · 2 marks
Let AA be a priority queue for maintaining a set of elements. Suppose AA is implemented using a max-heap data structure. The operation EXTRACT-MAX(A)\text{EXTRACT-MAX} (A) extracts and deletes the maximum element from AA. The operation INSERT⁡(A,key)\operatorname{INSERT}(A, key ) inserts a new element keykey in AA. The properties of a max-heap are preserved at the …
Official PYQ2021Programming and Data StructuresBinary HeapsMCQ · 1 mark
​​​​​Let HH be a binary min-heap consisting of nn elements implemented as an array. What is the worst case time complexity of an optimal algorithm to find the maximum element in HH?
Official PYQ2020Programming and Data StructuresBinary HeapsNAT · 2 marks
Consider the array representation of a binary min-heap containing 10231023 elements. The minimum number of comparisons required to find the maximum in the heap is ___________.
Official PYQ2019Programming and Data StructuresBinary HeapsMCQ · 2 marks
Consider the following statements: The smallest element in a max-heap is always at a leaf node The second largest element in a max-heap is always a child of a root node A max-heap can be constructed from a binary search tree in Θ(n)\Theta(n) time A binary search tree can be constructed from a max-heap in Θ(n)\Theta(n) time Which of the above statements are …
Official PYQ2018Programming and Data StructuresBinary HeapsNAT · 2 marks
The number of possible min-heaps containing each value from {1,2,3,4,5,6,7}\{1,2,3,4,5,6,7\} exactly once is _______
Official PYQ2016Programming and Data StructuresBinary HeapsMCQ · 1 mark
An operator delete(i)(i) for a binary heap data structure is to be designed to delete the item in the ii-th node. Assume that the heap is implemented in an array and ii refers to the ii-th index of the array. If the heap tree has depth dd (number of edges on the path from the root to the farthest leaf ), then what is the time complexity to …
Official PYQ2016Programming and Data StructuresBinary HeapsNAT · 1 mark
A complete binary min-heap is made by including each integer in [1,1023][1, 1023] exactly once. The depth of a node in the heap is the length of the path from the root of the heap to that node. Thus, the root is at depth 00. The maximum depth at which integer 99 can appear is _________.
Official PYQ2015Programming and Data StructuresBinary HeapsMCQ · 1 mark
Consider a max heap, represented by the array: 40,30,20,10,15,16,17,8,440, 30, 20, 10, 15, 16, 17, 8, 4. …
Official PYQ2015Programming and Data StructuresBinary HeapsMCQ · 1 mark
Consider a complete binary tree where the left and right subtrees of the root are max-heaps. The lower bound for the number of operations to convert the tree to a heap is
Official PYQ2015Programming and Data StructuresBinary HeapsMCQ · 1 mark
Consider the following array of elements. ⟨89,19,50,17,12,15,2,5,7,11,6,9,100⟩\langle 89, 19, 50, 17, 12, 15, 2, 5, 7, 11, 6, 9, 100 \rangle The minimum number of interchanges needed to convert it into a max-heap is
Official PYQ2014Programming and Data StructuresBinary HeapsMCQ · 1 mark
A priority queue is implemented as a Max-Heap. Initially, it has 55 elements. The level-order traversal of the heap is: 10,8,5,3,210, 8, 5, 3, 2. Two new elements 11 and 77 are inserted into the heap in that order. The level-order traversal of the heap after the insertion of the elements is:
Official PYQ2011Programming and Data StructuresBinary HeapsMCQ · 1 mark
A max-heap is a heap where the value of each parent is greater than or equal to the value of its children. Which of the following is a max-heap?
Official PYQ2009Programming and Data StructuresBinary HeapsMCQ · 1 mark
Consider a binary max-heap implemented using an array. Which one of the following array represents a binary max-heap?
Official PYQ2009Programming and Data StructuresBinary HeapsMCQ · 1 mark
Consider a binary max-heap implemented using an array. What is the content of the array after two delete operations on {25,14,16,13,10,8,12}\left\{25,14,16,13,10,8,12\right\}
Official PYQ2007Programming and Data StructuresBinary HeapsMCQ · 1 mark
Consider the process of inserting an element into a Max Heap\text{Max Heap}, where the Max Heap\text{Max Heap} is represented by an array. Suppose we perform a binary search on the path from the new leaf to the root to find the position for the newly inserted element, the number of comparisons performed is:
Official PYQ2006Programming and Data StructuresBinary HeapsMCQ · 1 mark
Statement for Linked Answer Questions 76 & 77: A 33-ary max heap is like a binary max heap, but instead of 22 children, nodes have 33 children. A 33-ary heap can be represented by an array as follows: The root is stored in the first location, a[0]a[0], nodes in the next level, from left to right, is stored from a[1]a[1] to a[3]a[3]. The nodes …
Official PYQ2006Programming and Data StructuresBinary HeapsMCQ · 1 mark
Statement for Linked Answer Questions 76 & 77: A 33-ary max heap is like a binary max heap, but instead of 22 children, nodes have 33 children. A 33-ary heap can be represented by an array as follows: The root is stored in the first location, a[0]a[0], nodes in the next level, from left to right, is stored from a[1]a[1] to a[3]a[3]. The nodes …