Fundamental Algorithms
Homework #1

Due Date: Monday Feb. 1

  1. Problem 1.0 (See back of text, page 393)
  2. Find the g.c.d. of a=377, b=610. Write down all iterations and count their number. What is the worst case for the Euclideau Algorithm (when will a and b require a maximal number of iterations)?
  3. Provide an algorithm for finding the median of 5 numbers. Try to minimize the number of comparisions required by your algorithm. Explain your ansers.