Question: 5. Find a theta notation for the following: T(n) = 4T(n/2) + n Explain how you got your solution. 6. Given the following code:
5. Find a theta notation for the following: T(n) = 4T(n/2) + n Explain how you got your solution. 6. Given the following code: fun (n) { if (n == 1) return; else { for x = 1 to n { x = x + 1; print (x); } fun (n/2) fun (n/2) fun (n/2) fun (n/2) } } What is the exact bound on the running time, i.e., f(n)= (?)
Step by Step Solution
There are 3 Steps involved in it
5 To find the notation for Tn 4Tn2 n we can use the Master theorem for divideandconquer recurrences ... View full answer
Get step-by-step solutions from verified subject matter experts
