subject
Computers and Technology, 27.08.2021 23:50 qhenley

Consider the following version of the Euclidean algorithm to compute gcd(a, b). Start with computing the largest power of 2 dividing both a and b. If this is 2", then divide a and b by 2". After this "preprocessing", do the following: Step 1: Swap the numbers if necessary to have a s b;
Step 2: If a = 0, then check the parities of a and b; if a is even, and b is odd, then replace a by a/2; if both a and b are odd, then replace b by b - a; in each case, go to step (1);
Step 3: If a = 0, then return 2" b as the greatest common denominator.

Required:
a. Show that the modified Euclidean algorithm always terminates with the right answer.
b. Show that this algorithm, when applied to two 100-digit integers, does not take more than 1500 iterations.

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 00:00, amyeileen
11. is the ability to understand how another person is feeling. a. authority b. sympathy c. empathy d. taking a stand
Answers: 1
image
Computers and Technology, 22.06.2019 11:40, silviamgarcia
Pthreads programming: create and terminate a thread write a c++ program that creates a thread. the main will display a message “hello world from the main”. the main will create a thread that will display a message “hello world from the thread” and then terminates with a call to pthread_exit()
Answers: 3
image
Computers and Technology, 23.06.2019 09:00, amberpublow7
Which best describes the role or restriction enzymes in the analysis of edna a. to break dna into fragments that vary in size so they can be sorted and analyzed b. to amplify small amounts of dna and generate large amounts of dna for analysis c. to purify samples of dna obtained from the environment so they can be analyzed d. to sort different sizes of dna fragments into a banding pattern that can be analyzed
Answers: 1
image
Computers and Technology, 23.06.2019 18:40, brooklyn4932
How does is make you feel when you're kind to others? what are some opportunities in your life to be more kind to your friends and loved ones? imagine a world where kindness has be outlawed. how would people act differently? would your day-to-day life change significantly? why or why not?
Answers: 2
You know the right answer?
Consider the following version of the Euclidean algorithm to compute gcd(a, b). Start with computing...

Questions in other subjects:

Konu
Mathematics, 21.04.2020 19:21
Konu
History, 21.04.2020 19:22