Question: Do not paste other's answer just need Algorithms Recall that our array indices start with 1. Use the same name and notation for heap-operations as
Do not paste other's answer
just need Algorithms

Recall that our array indices start with 1. Use the same name and notation for heap-operations as in the textbookotes. You may use any standard-heap operation without specifying details. You may assume that the values stored in the heap are integers. (1) (10 pts) (la) Present algorithm indexBottomLeft(h) that, given a nonempty min- heap h, returns the array-index of the left-most node at the bottom- most level. On a minheap of size n, your algorithm must run in O(log n) time. You are forbidden to use any math library functions/methods/algorithms. (1b) Present algorithm deleteBottomLeft(h) that, given a nonempty min- heap h, deletes the value in the left-most node at the bottom-most level from minheap h (resulting in a smaller minheap). On a minheap of size n, your algorithm must run in O(log n) time. (2) (10 pts) Present algorithm delete (h, i) that, given a nonempty minheap h and a valid array-index i, deletes the value in the node with array- index i (i.e value in the node at h[i]) from minheap h (resulting in a smaller minheap). On a heap h with n nodes your algorithm must run in O(log n) time
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
