# We consider the following recursive algorithm for computing the gcd of two integers: Binary…

We consider the following recursive algorithm for computing the gcd of two integers: Binary Euclidean Algorithm

Input: a, b exist in N >0; Output: gcd(a,b) exist in N

1. If a = b then return a;

2. If both a and b are even return 2 * gcd(a/2, b/2);

3. If exactly one of the two numbers, say a, is even then return gcd(a/2,b);

4. If both a and b are odd and, say, a > b, then return gcd((a – b)/2, b).

Question: (i) Run the algorithm on the following examples: (a) 34, 21 (b) 136, 51 (c) 481, 325 (d) 8771, 3206 .

(ii) Prove that the algorithm works correctly.

(iii) Find a “good” upper bound on the recursion depth of the algorithm, and show that it takes O(n*n) word operations on inputs of length at most n.

(iv) Modify the algorithm so that it additionally computes s,t exist in N such that sa + tb = gcd(a,b).

## Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
\$26
The price is based on these factors:
Number of pages
Urgency
Basic features
• Free title page and bibliography
• Unlimited revisions
• Plagiarism-free guarantee
• Money-back guarantee
On-demand options
• Writer’s samples
• Part-by-part delivery
• Overnight delivery
• Copies of used sources
Paper format
• 275 words per page
• 12 pt Arial/Times New Roman
• Double line spacing
• Any citation style (APA, MLA, Chicago/Turabian, Harvard)

# Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

### Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

### Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

### Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.