Page 1 of 1

c) Modify Euclid's algorithm as follows function Newclid(a,b) if a
Posted: Thu Jun 02, 2022 7:52 am
by answerhappygod
C Modify Euclid S Algorithm As Follows Function Newclid A B If A B Swap A And B If B 0 Return A Return Newclid A B B 1
C Modify Euclid S Algorithm As Follows Function Newclid A B If A B Swap A And B If B 0 Return A Return Newclid A B B 1 (79.56 KiB) Viewed 17 times
c) Modify Euclid's algorithm as follows function Newclid(a,b) if a<b: swap a and b if b-0: return a return Newclid(a-b,b) i. Does Newclid(a,b) still compute gcd(a, b)? Briefly justify your answer. ii. Show that Newclid(a,b) is exponentially slower than Euclid(a,b) on certain inputs. [3 marks] [3 marks]