Question: 3. Below is an algorithm for computing b. {Input: a number b and a positive integer n Output: b] : begin :while 2 > 0

3. Below is an algorithm for computing b". {Input: a number b and a positive integer n Output: b"] : begin :while 2 > 0 do if is odd end [if) Do the next two steps whether or not i is odd.} :i:-floor(i/2) end (while) :return p end (a) Show that the algorithm makes O(log2n) passes through the while loop (b) How many passes does the algorithm make through the loop for n-3, n 2100 and n-3. 2100
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
