Question: 7. Consider the following pseudocode. procedure pname(N: a positive integer) k:= 0 9:= N/2 while q =[q] k=k+1 q=g/2 return k (a) (6 points)

7. Consider the following pseudocode. procedure pname(N: a positive integer) k:= 0

 

7. Consider the following pseudocode. procedure pname(N: a positive integer) k:= 0 9:= N/2 while q =[q] k=k+1 q=g/2 return k (a) (6 points) What is the value returned by this procedure when N = 7, 12, and 16, respectively? Explain your answer. (b) (5 points) Describe what this algorithm does. What is the value returned by this procedure when it takes N, a positive integer, as its input?

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 Programming Questions!