- 5 The Recursive Algorithm Given Below Can Be Used To Compute Ged A B Where A And B Are Non Negative Integer Not Both 1 (56.69 KiB) Viewed 89 times
5. The recursive algorithm given below can be used to compute ged(a, b) where a and b are non-negative integer, not both
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
5. The recursive algorithm given below can be used to compute ged(a, b) where a and b are non-negative integer, not both
5. The recursive algorithm given below can be used to compute ged(a, b) where a and b are non-negative integer, not both zero. procedure ged(a, b) if a > b then ged(a,b) := ged(b, a) else if a =0 then ged(a,b) := b else if a = 1 then ged(a, b) :=1 else if a and b are even then ged(a, b) := 2gcd (a/2,6/2) else if a is odd and b is even then ged(a,b) := ged(a, b/2) else ged(a, b) := ged(a, b - a) Use this algorithm to compute (a) gcd(124, 244) (b) god (4424, 2111).