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).
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).
Related questions
Question
100%
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps