Question: Problem 2. [Category: Analyzing Iterative Algorithms] Consider the following two programs (where / denotes integer division) (a). x0 forkndownto1dopkwhilep>1dopp/5xx+1 (b). x0 fork1to2ndop0skwhilepsdopp+2xx+1 Assume that arithmetic
![Problem 2. [Category: Analyzing Iterative Algorithms] Consider the following two programs](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f2f47602053_32566f2f4757d245.jpg)

Problem 2. [Category: Analyzing Iterative Algorithms] Consider the following two programs (where "/" denotes integer division) (a). x0 forkndownto1dopkwhilep>1dopp/5xx+1 (b). x0 fork1to2ndop0skwhilepsdopp+2xx+1 Assume that arithmetic operations take constant time, no matter the size of the operands. For these two programs 1. Estimate the running time of the inner (while) loop respect to k for program in (a) and (b). You should give a tight bound, of the form (f(k)) with f as simple as possible, but you do not need to justify your answer. [10 points] 2. Estimate the total running time of the program in (a) and (b). You can first express it as a summation with respect to the inner loop or use your own way, but you should give a tight bound of the form (g(n)) with g as simple as possible. You do not need to further justify your answer. [10 points]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
