Question
1.Suppose that, in a divide-and-conquer algorithm, we always divide an instance of size n of a problem into 3 subinstances of size n/2, and the
1.Suppose that, in a divide-and-conquer algorithm, we always divide an instance of size n of a problem into 3 subinstances of size n/2, and the dividing and combining steps take linear time. Write a recurrence equation for the running time T (n), and solve this recurrence equation for T (n). Show your solution in order notation.
2. Implement both algorithms of Fibonacci Sequence (i.e., the Divide and Conquer algorithm and the dynamic algorithm). Determine the largest number that the Divide and Conquer algorithm can accept as its argument and still compute the answer within 60 seconds. Report how long it takes the dynamic algorithm to compute this answer.
Use java or C++ to compile the code.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started