Solved

Given Non-Negative Integers a and B, Their Greatest Common Divisor

Question 28

Essay

Given non-negative integers A and B, their greatest common divisor is the largest integers that divides both A and B evenly, denoted gcd(A, B). Observe that for any A, gcd(A, 0) = A. Also, if A < B, then gcd(A, B) = gcd(A, B - A). Finally, for any A and B, gcd(A, B) = gcd(B, A). Use these three properties to develop an algorithm to compute greatest common divisors.

Correct Answer:

verifed

Verified

This is a recursive problem. The base ca...

View Answer

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions