Question: Consider the procedure T given below. procedure T(n: positive integer) for i = 1 to n for j = 1 to n x = x
Consider the procedure T given below. procedure T(n: positive integer) for i = 1 to n for j = 1 to n x = x + g(x)//Assume that g can be computed in constant time return T(n/2) + T(n/2) + T(n/2) Let f(n) be the number of additions in the procedure for an input of n and note that f (n) satisfies a recurrence relation of the form f(n) = a f(n/b) + cn^d. a) Determine the values of a, b, c, and d. b) Apply The Master Theorem (given below) to T to determine its complexity. Master Theorem Given f(n) = a f (n/b) + cn^d, then f(n) id {theta(n^d) if a b^d
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
