Question: Problem 4.(10 points) Complete the following function that deletes the itemin locationifrom heap A and still maintains the heap property. Your imple-mentation should run inO(logn)
Problem 4.(10 points) Complete the following function that deletes the itemin locationifrom heap A and still maintains the heap property. Your imple-mentation should run inO(logn) time for ann-element min-heap. Prove thetime-complexity of your algorithm.HEAPDELETE(A,i)Input:Min-Heap A[1..n], indexi,1inOutput:Min-Heap A[1..n-1] after deleting A[i]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
