For Listing 5.8, another solution to find the greatest common divisor of two integers n1 and n2 is as follows: First find d to be the minimum of n1 and n2, and then check whether d, d - 1, d - 2, ..., 2, or 1 is a divisor for both n1 and n2 in this order. The first such common divisor is the greatest common divisor for n1 and n2.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here