Week - 2
Solutions for Week - 2 Questions
Last updated
Solutions for Week - 2 Questions
Last updated
Find the time complexity of the following recurrence relation using forward substitution: Soln: Derive the value of T(n) for values starting from 1
n
T(n)
1
3
2
9
3
27
Generic equation : For i=n ,
Solve recurrence Soln: Generic equation Substitute (base condition)
is ignored
Use Master theorem to solve the following recurrence relation. (Indicate the case and the solution) For all the cases, consider a) Case 2 : b) Master's theorem cannot be applied as a is not constant c) Case 3: Regularity condition = c=(1/2) = 0.5 condition holds d) Case 1: e) Case 3: Regularity condition = c=(7/9) = 0.7 condition holds
Draw the recursion tree and derive cost for recurrence
Can master theorem be used for recurrence relation which takes a poly-logarithmic number of basic operations? [ Extended version of masters theorem ] Yes (Refer to slides in the classroom)