...
DSSSB PGT 2021
October 7, 2023
Operating-Systems
October 7, 2023
DSSSB PGT 2021
October 7, 2023
Operating-Systems
October 7, 2023

Data-Structures

Question 228
Given a binary-max heap. The elements are stored in an array as 25, 14, 16, 13, 10, 8, 12. What is the content of the array after two delete operations?
A
14,13,8,12,10
B
14,12,13,10,8
C
14,13,12,8,10
D
14,13,12,10,8
Question 228 Explanation: 
Step-1: Initially, the heap structure is

Step-2: We have to perform 2 delete operations.
In max-heap (or) min-heap by default we are deleting root element only.
After 1st delete, the heap structure is


Step-3: After 2nd delete operation, the heap structure is

Correct Answer: C
Question 228 Explanation: 
Step-1: Initially, the heap structure is

Step-2: We have to perform 2 delete operations.
In max-heap (or) min-heap by default we are deleting root element only.
After 1st delete, the heap structure is


Step-3: After 2nd delete operation, the heap structure is

0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
error: Alert: Content selection is disabled!!