DSSSB PGT 2021
October 7, 2023OperatingSystems
October 7, 2023DataStructures
Question 228

Given a binarymax 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?
14,13,8,12,10


14,12,13,10,8


14,13,12,8,10


14,13,12,10,8

Question 228 Explanation:
Step1: Initially, the heap structure is
Step2: We have to perform 2 delete operations.
In maxheap (or) minheap by default we are deleting root element only.
After 1st delete, the heap structure is
Step2: We have to perform 2 delete operations.
In maxheap (or) minheap by default we are deleting root element only.
After 1st delete, the heap structure is
Step3: After 2nd delete operation, the heap structure is
Correct Answer: C
Question 228 Explanation:
Step1: Initially, the heap structure is
Step2: We have to perform 2 delete operations.
In maxheap (or) minheap by default we are deleting root element only.
After 1st delete, the heap structure is
Step2: We have to perform 2 delete operations.
In maxheap (or) minheap by default we are deleting root element only.
After 1st delete, the heap structure is
Step3: After 2nd delete operation, the heap structure is
Subscribe
Login
0 Comments