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.
6 on this page
In a binary max heap containing numbers, the smallest element can be found in time
A priority queue is implemented as a Max-Heap. Initially, it has elements. The level-order traversal of the heap is: . Two new elements and are inserted into the heap in that order. The level-order traversal of the heap after the insertion of the elements is:
The elements are inserted one by one in the given order into a maxHeap. The resultant maxHeap is
In a min-heap with elements with the smallest element at the root, the smallest element can be found in time
Consider any array representation of an element binary heap where the elements are stored from index to index of the array. For the element stored at index of the array , the index of the parent is
The minimum number of interchanges needed to convert the array into a max-heap is
