McqMate
| Q. |
What is the GCD of a and b? |
| A. | a + b |
| B. | gcd (a-b, b) if a>b |
| C. | gcd (a+b, a-b) |
| D. | a – b |
| Answer» B. gcd (a-b, b) if a>b | |
| Explanation: as per euclid’s algorithm, gcd (a, b) = gcd (a-b, b) if a > b or gcd (a, b) = gcd (a, b-a) if b > a. | |
View all MCQs in
Design and Analysis of AlgorithmsNo comments yet