Question: write in java screenshoot for the output 1. Code the three algorithms covered in Chapter 1 to solve the Greatest Common Divisor (use long as

1. Code the three algorithms covered in Chapter 1 to solve the Greatest Common Divisor (use long as number types). 2. Provide the running times of the different algorithms using the given instances. Running times of different form 20 Algorithms ALGORITHM1 Euclidim,n) Input: Two non-negative, not-both-cero integers mand Output: Greatest Common Divisor of mand whileno do rem mod n ner return m ALGORITHM 2 CICA(m, n) Input: Two non-negative, not-both-zero integers m and n Output Greatest Common Divisor of mandn 1 minim, n) stop false while stop false do ifm modt0 AND modto stop true; Elsett returnt University of Bala- College of luformation Technology - Department of Computers ITCS346-347 Sat 1&2 2020 2021 2 - Dr. Youssef Parrot Harrath's algorithm 3 for computing edim, Step 1 If n = 0, return m else go to step 2 Step 2 if m=0, return nelse go to step 3 Step 3 if m divides n return melse go to step 4 Step 4 if n divides m return, else go to steps Step 5 Find the divisors of m Step 6 Find the divisors of Step 7 Find the common divisors between mandn Step 8 gedim, n) = the greatest common divisor between mando Instances GCD.) 11 12 13 Instance 1 2 3 4 5 1250 25000 25 178205 20347796 1458 18497562 2582599941714720 210 4:10
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
