
Patrick B. answered 01/25/21
Math and computer tutor/teacher
Here are the recursive calls
beginning with a=13 b=20
gcd(13,20)
gcd(7,13)
gcd(6,7)
gcd(1,6)
gcd(0,1)
returns 1
Nupur P.
asked 01/25/211. Trace algorithm shown above when it finds gcd(13 ,20). That is, show all the steps used by the algorithm shown above to find gcd(13 ,20).
procedure gcd(a ,b nonnegative integers with a>b)
if a=0 then return b
else return gcd (b mod a ,a)
{output is gcd(a, b) }
Patrick B. answered 01/25/21
Math and computer tutor/teacher
Here are the recursive calls
beginning with a=13 b=20
gcd(13,20)
gcd(7,13)
gcd(6,7)
gcd(1,6)
gcd(0,1)
returns 1
Get a free answer to a quick problem.
Most questions answered within 4 hours.
Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.