- Q Find The Big O And Correctness 3 Sample Cases For The Following Three Algorithms Algorithm 1 Ged A B Input Two 1 (31.22 KiB) Viewed 39 times
Q: find the big(o) and correctness, 3 sample cases. for the following three algorithms Algorithm 1: ged(a, b) Input: Two
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
Q: find the big(o) and correctness, 3 sample cases. for the following three algorithms Algorithm 1: ged(a, b) Input: Two
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