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 For the following algorithm calls, prove a tight asymptotic bound for their 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 worst-case running time. Pay attention to the input in the alrogithm calls! 2 and b a) The call to RECURSIVE-ALGORITHM(n) for some n>1 1. RECURSIVE-ALGORITHM(a); 2. 1 2 then

3. u = a/3;

4. v = b-1;

5. RECURSIVE-ALGORITHM2(u ,v);

= 0; 3. if a 1 then 4. for i = 1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!