GATE 2009
January 13, 2025
GATE-2024-CS1(Forenoon)
January 13, 2025
GATE 2009
January 13, 2025
GATE-2024-CS1(Forenoon)
January 13, 2025

GATE-2024-CS1(Forenoon)

Question 41
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 heapified array?
A
82, 90, 101
B
82, 11, 93
C
131, 11, 93
D
131, 111, 90
Question 41 Explanation: 
After heapifying the given array, the root element will be the maximum value. So, the root element is 131.

Now, let’s consider the options again:

(A) 82, 90, 101 – This cannot be correct because the root element, which is the maximum, is not included.
(B) 82, 11, 93 – This cannot be correct because the second element is not necessarily the second maximum in the array.
(C) 131, 11, 93 – This cannot be correct because 11 and 93 are not necessarily the next largest values after the root.
(D) 131, 111, 90 – This is the most likely option because after the root (131), the next largest values in the array are 111 and 90.

Correct Answer: D
Question 41 Explanation: 
After heapifying the given array, the root element will be the maximum value. So, the root element is 131.

Now, let’s consider the options again:

(A) 82, 90, 101 – This cannot be correct because the root element, which is the maximum, is not included.
(B) 82, 11, 93 – This cannot be correct because the second element is not necessarily the second maximum in the array.
(C) 131, 11, 93 – This cannot be correct because 11 and 93 are not necessarily the next largest values after the root.
(D) 131, 111, 90 – This is the most likely option because after the root (131), the next largest values in the array are 111 and 90.

0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x