Question: Problen 6 . ( ( 1 5 + 1 5 = 3 0 ) points ) Resul Sertion 1 0 . 6 carefolls
Problen points Resul Sertion carefolls bufore uthenting this problem. Analyge the puming time of the following algorithu using a step count analysis as showa in the Homer scheme Example :
determine the number of digits of an integer n
binarydigitsn cost times
int ont cl
Wijile ii do ic
cnt cnt c
n floor nQ c
endwhile
return ent
c:
c
a Fitl im the s in the above code each with a nomber or an expression involving a that expresses tho step count for the line uf code.
b Detenume the worstase emppexity of this algorithm as a function of n and give it in the Theta notation. Show your work and explain using the defintion of Theta involying ther irecgualities.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
