Answered step by step
Verified Expert Solution
Question
1 Approved Answer
For the following algorithm calls, prove a tight asymptotic bound for their worst-case running time. Pay attention to the input in the alrogithm calls !
For the following algorithm calls, prove a tight asymptotic bound for their worst-case running time. Pay attention to the input in the alrogithm calls!
a) The call to RECURSIVE-ALGORITHM(n) for some n>1
1. RECURSIVE-ALGORITHM(a);
2. 1 = 0;
3. if a 1 then
4. for i = 1 to floor{a} do
5. q=q+1
6. RECURSIVE-ALGORITHM(a/2);
7. RECURSIVE-ALGORITHM(a/5);
8. RECURSIVE-ALGORITHM(a/9);
b) The call to RECUSRIVE-ALGORITHM2(n, n) for some n > 2.
1. RECURSIVE-ALGORITHM2(a, b);
2. if a 2 and b 2 then
3. u = a/3;
4. v = b-1;
5. RECURSIVE-ALGORITHM2(u ,v);
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