Given a binary-max heap. The elements are stored in an arrays as 25, 14, 16, 13, 10, 8, 12.What is the content of the array after two delete operations?
Given a binary-max heap. The elements are stored in an arrays as 25, 14, 16, 13, 10, 8, 12.What is the content of the array after two delete operations? Correct Answer 14, 13, 12, 8, 10
Key Points
In a binary max-heap deletion is always done at the root.
STEPS:
- Delete the root node.
- Replace it with the rightmost leaf node and call heapify( ) procedure again.
Max heap: Deletion
[ alt="F1 Shraddha Raju 22.02.2021 D1" src="//storage.googleapis.com/tb-img/production/21/02/F1_Shraddha_Raju_22.02.2021_D1.png" style="width: 458px; height: 556px;">
Heap elements: 14,13,12,8,10,
Therefore the correct answer is option 3.
মোঃ আরিফুল ইসলাম
Feb 20, 2025