Question: Write a recurrence relation describing the worst case running time of each of the following algorithms and determine the asymptotic complexity of the function defined

Write a recurrence relation describing the worst case running time of each of the following algorithms and determine the asymptotic complexity of the function defined by the recurrence relation. Justify your solution using either substitution, a recursion tree or induction. You may NOT use the Master theorem. Assume that all arithmetic operations take constant time. Simplify and express your answer as $\Theta\left(n^{k} ight) $ or $\Theta\left(n^{k}(\log n) ight) $ wherever possible. If the algorithm takes exponential time, then just give exponential lower bounds. func1 $(A, n) $ $\ A=$ array of $n$ integers 1 if $(n \leq 10$ then return $A[1] ;$ $2 \quad \leftarrow A[\lfloor n / 2 floor]+A[n] ;$ $3 \quad x \leftarrow x+$ func1 $(A,\lfloor 5 n / 8 floor) ;$ 4 return $(x) ;$ CS.VS. 1161|
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
