Course Solutions Uncategorized (Solved) : Consider Following Recursive Algorithm Input Two Integers Z Y Outputs Integer F X Y Prog Z Q29649012 . . . .

(Solved) : Consider Following Recursive Algorithm Input Two Integers Z Y Outputs Integer F X Y Prog Z Q29649012 . . . .

 

Consider the following recursive algorithm that on input two integers z, y outputs some other integer f(x, y) prog(z,y) if (y <0) then prog(-x,-y) else if (y-0) then 0 else if even(v) then prog(2- x,y/2) else (x +prog(x.y - 1)) Notice, the program computes y/2 only when y is even, so the division is always exact. (a) Compute prog(x, y) on a few test values of your choice, and determine the function f(x, y) computed by the program. Your answer should include at least 5 tests (e.g., prog(4,0) 0), but you do not need to include the intermediate steps 

<div class=

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post