Question: A binary heap can be represented as an array. For a node at position i, its left child is at position 2i+1 and its right

A binary heap can be represented as an array. For a node at position i, its left child is at position 2i+1 and its right child is at position 2i+2, and its parent is at index (i - 1)/2. If a heap is represented by the following array: [58, 45, 42, 29, 21. 15. 32. 7, 11] After removing the root 58 and rebuilding the heap, we can obtain a new heap. What is the array representing the new heap? (Please show detailed steps for full credits)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
