Question: 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
Get step-by-step solutions from verified subject matter experts
