Search for question
Question

6. [10 points] Given two natural numbers a and b, we want to compute the greatest common divisor (GCD) of a and b. (i) Design a simple non-recursive algorithm GCD(a, b) to solve the problem. (ii) Design a simple recursive algorithm GCD(a, b) to solve the problem.

Fig: 1