Heap Tree: GATE CS Previous Year Questions

Heap Tree · Data Structures

32 questions · asked in 20 of 27 years (2000–2026)

MCQ 27 · MSQ 1 · NAT 41-mark 19 · 2-mark 13

2000Questions per year2026

Questions 26–30 of 32

Q26GATE 20061 markMCQ−0.33 if wrong
In a binary max heap containing n numbers, the smallest element can be found in time

Q27GATE 20051 markMCQ−0.33 if wrong
A Priority-Queue is implemented as a Max-Heap. Initially, it has 5 elements. The level-order traversal of the heap is given below:

10, 8, 5, 3, 2

Two new elements '1' and '7' are inserted in the heap in that order. The level-order traversal of the heap after the insertion of the elements is:

Q28GATE 20041 markMCQ−0.33 if wrong
An array of integers of size n can be converted into a heap by adjusting the heaps rooted at each internal node of the complete binary tree starting at the node ⌊(n−1)/2⌋\left \lfloor (n - 1) /2 \right \rfloor, and doing this adjustment up to the root node (root node is at index 0) in the order ⌊(n−1)/2⌋\left \lfloor (n - 1) /2 \right \rfloor,⌊(n−3)/2⌋\left \lfloor (n - 3) /2 \right \rfloor, ....., 0. The time required to construct a heap in this manner is

Q29GATE 20041 markMCQ−0.33 if wrong
The elements 32, 15, 20, 30, 12, 25, 16, are inserted one by one in the given order into a MaxHeap. The resultant MaxHeap is
32 30 25 15 12 20 16 (a) 32 25 30 12 15 20 16 (b) 32 30 25 15 12 16 20 (c) 32 25 30 12 15 16 20 (d)

Q30GATE 20031 markMCQ−0.33 if wrong
A data structure is required for storing a set of integers such that each of the following operations can be done in O(logn) time, where n is the number of elements in the set.

1. Delection of the smallest element.
2. Insertion of an element if it is not already present in the set.

Which of the following data structures can be used for this purpose ?

Keep practising

Topics in Data Structures

All CS topics ›