Q: find the big(o) and correctness, 3 sample cases. for the following three algorithms Algorithm 1: ged(a, b) Input: Two
Posted: Fri Jul 01, 2022 5:42 am
Q: find the big(o) and correctness, 3 sample cases. for the following three algorithms Algorithm 1: ged(a, b) Input: Two integers a and b Result: The greatest common divisor of a and b if a then return a else if a> & then return god(a-b.b) return god(a,b-a) else end Algorithm 2: ged(a, b) Input: Two integers a and b Result: The greatest common divisor of a and b if &-0 then return a else re-a mod b return god(b, r) end Algorithm 3: ged(a, b) Input: Two integers a and b Result: The greatest common divisor of a and b while 60 do ra mod b a+b end return a