Home Work Number 2 Fall 2009

This is Home Work Number 2 - Due on september 17

Do the following five problems.
  1. Implement Merge3Sort program in C++ (the algorithm was designed in Lab 1)
  2. Question 1.37 a (Das Gupta et al)
  3. Question 1.38 (Das Gupta et al)
  4. One of the applications of Computing with numbers is in Hash Table. Please read section 11.1 (page 222 of CLR's book) and do exercise 11.1-1 in Page 222.
  5. An Extended Euclidean algorithm is often used in solving number theoretic/cryptographic algorithms It is also given in Das Gupta et al's book.
    Input: Two positive integers a and b, a >= b >=0 
    Output: Integers x, y and d such  d = gcd(a,b) and a*x + b*y = d
    Extended_Euclidean(a,b)
    if b == 0 return (1,0,a)
    (x1,y1,d) = Extended_Euclidean(b, a mod b)
    return (y1,x1-floor(a/b)*y1,d)
    

    Besides implementing and running, do an example by hand for a=200, and b = 155.