Consider the following three methods of solving a particular problem (input size n): 1. You divide the problem into seven subproblems, each the size of the original problem, solve each recursively, then combine the results with a cost 12n +3 where n is the original problem size. 2. You reduce the problem size by 2, solve the subproblem recursively, then com- bine the results with a cost 120 operations. 3. You divide the problem into 2 subproblems, each of size of the original problem, solve each recursively, then combine the results with a cost 2n²+3n+5 where n is the original problem size. Assume the base case has size 1 for all three methods. For each method, write a recurrence capturing its worst-case runtime. Which of the three methods yields the fastest asymptotic runtime? In your solution, you should use the Master Theorem wherever possible. In the case where the Master Theorem doesn't apply, clearly state why not based on your recurrence, and show your work solving the recurrence using another method (no proofs required).

icon
Related questions
Question
100%
Consider the following three methods of solving a particular problem
(input size n):
1. You divide the problem into seven subproblems, each the size of the original
problem, solve each recursively, then combine the results with a cost 12n +3
where n is the original problem size.
2. You reduce the problem size by 2, solve the subproblem recursively, then com-
bine the results with a cost 120 operations.
3. You divide the problem into 2 subproblems, each of size of the original
problem, solve each recursively, then combine the results with a cost 2n²+3n+5
where n is the original problem size.
Assume the base case has size 1 for all three methods.
For each method, write a recurrence capturing its worst-case runtime. Which of
the three methods yields the fastest asymptotic runtime?
In your solution, you should use the Master Theorem wherever possible. In the
case where the Master Theorem doesn't apply, clearly state why not based on your
recurrence, and show your work solving the recurrence using another method (no
proofs required).
Transcribed Image Text:Consider the following three methods of solving a particular problem (input size n): 1. You divide the problem into seven subproblems, each the size of the original problem, solve each recursively, then combine the results with a cost 12n +3 where n is the original problem size. 2. You reduce the problem size by 2, solve the subproblem recursively, then com- bine the results with a cost 120 operations. 3. You divide the problem into 2 subproblems, each of size of the original problem, solve each recursively, then combine the results with a cost 2n²+3n+5 where n is the original problem size. Assume the base case has size 1 for all three methods. For each method, write a recurrence capturing its worst-case runtime. Which of the three methods yields the fastest asymptotic runtime? In your solution, you should use the Master Theorem wherever possible. In the case where the Master Theorem doesn't apply, clearly state why not based on your recurrence, and show your work solving the recurrence using another method (no proofs required).
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
  • SEE MORE QUESTIONS