Assignment 1 Advanced Algorithm
Assignment 1 Advanced Algorithm
Assignment 1
Deadline: Tuesday 15th October 2024
Master theorem is a quick-fix solution to find the time complexity of a recursive algorithm
particularly divide and conquer algorithms. It says that if a divide and conquer algorithm
divides a problem into a subproblems each of size b and that the cost to conquer and combine
is f (n) = Θ(nd ) then we have a recursive relationship that looks like this
You have read more in the textbook as well as on the internet. Once you are comfortable
with the master theorem, please solve the following question:
Question 1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5 points
What is the time complexity of a recursive algorithm with the following recursive time
complexity equation? Show working.
Question 2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5 points
What is the time complexity of a recursive algorithm with the following recursive time
complexity equation? Show working.
√
T (n) = 2T (n/4) + n + 42
Question 3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5 points
What is the time complexity of a recursive algorithm with the following recursive time
complexity equation? Show working.
1
T (n) = T (n/2) + × n2 + n
2