The greatest common divisor (GCD) of two numbers a and b is defined as follows: If a
Question:
The greatest common divisor (GCD) of two numbers a and b is defined as follows: If a > b, then (gcd a b) is gcd of a - b and b. Else, if a
1. Define a function gcd that computes the GCD according to the definition given here.
The following interaction log illustrates the function:
2. Use the function gcd to define GCDs that takes two lists of numbers and produces a third list that contains the list of GCDs of corresponding elements from the first and the second list. The following interaction log illustrates the function:
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Related Book For
An Experiential Introduction To Principles Of Programming Languages
ISBN: 9780262045452
1st Edition
Authors: Hridesh Rajan
Question Posted: