Define the gcd function for more than two arguments by the recursive equation gcd (a 0 ,a
Fantastic news! We've Found the answer you've been seeking!
Question:
Define the gcd function for more than two arguments by the recursive equation gcd (a 0 ,a 1 …a n ) = gcd (a 0 , gcd(a 1 ,a 2 ,….a n ). Show that the gcd function returns the same answer independent of the order in which its arguments are specified. Also show how to find integers x 0 , x 1 ….x n such that gcd (a 0 , a 1 , … a n ) = a 0 x 0 = a 1 x 1 + … + a n x n . Show that the number of divisions performed by your algorithm is O{n + lg(max{a o ,a 1 ,… a n })).
Related Book For
Introduction to Algorithms
ISBN: 978-0262033848
3rd edition
Authors: Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest
Posted Date: