We are tracing the recursive algorithm for computing gcd(a,b), then we will find gcd, trace it (8,13). That is, display all of the steps taken by the algorithm to determine gcd (8,13).
Step-by-step procedure:
procedure gcd(a=7,b=12)
if a = 0 then return b -> Since a is not 0, this step is skipped
else return gcd (12 mod 7, 7)
procedure gcd (a=5,b=7)
if a = 0 then return b -> Since a is not 0, this step is skipped
else return gcd (7 mod 5, 5)
procedure gcd (a=2,b=5)
if a = 0 then return b -> Since a is not 0, this step is skipped
else return gcd (5 mod 2, 2)
procedure gcd (a=1,b=2)
if a = 0 then return b -> Since a is not 0, this step is skipped
else return gcd (2 mod 1, 1)
procedure gcd (a=0,b=1)
if a = 0 then return b
else return gcd (b mod a, a) -> Since the value is returned, this step is never followed
Thus the output is 1.
To learn more about recursive, visit: https://brainly.com/question/14208577?source=aidnull
#SPJ4