Question: analysis of algorithms When parent's key becomes smaller than one (or both) of its children in a Heap, the sink method is called. The iterative
When parent's key becomes smaller than one (or both) of its children in a Heap, the sink method is called. The iterative algorithm for the sink method is given below: Sink (list, k, key, bound) while(2* lesserthanorequalto bound) do largerChild = 2*, k if (largerChild list[largerChild])) then largerChild = lagerChild + 1; enf if if(key > list[largerChild]) then break; exch(k, largerChild); //exchange values in loaction k and largerChild k = largerChild; end while Convert the above algorithm to a recursive algorithm Write a recurrence relation that computes the worst case running time tor your recursive algorithm. Use the maser method to approximate the order of the worst case running time o your recursive algorithm
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
