Assignment 7

By doing this assignment you should: Please note: There are additional requirements to some of the problems for this homework set. Please make sure that you accomplish all parts of this assignment.

Please do the following problems.

  1. Do Problem 1 page 156. Please provide two algorithms, one based on brute force and the other based on decrease and conquer.
  2. You are to maintain a data structure which can be searched rapidly for constantly changing data. IE new data is constantly arriving, but will never be deleted. The data consists of a key and a timestamp, and for the purposes of your program, you want to search based upon the key, but wish to retain the timestamps as well. Finally, you know that there will be MANY duplicate keys in the data.
    1. Discuss the choices for data structures you might employ.
    2. Select one data structure which you will employ. Justify your choice.
    3. Provide a c++ implementation of a structure which can support the data structure you have selected.
  3. Do question 10 on page 157. Argue informally the correctness of your algorithm.
  4. List the algorithm design methods which have been discussed in this class.
    1. What are the strengths/weaknesses of each design method.
    2. When is each method most appropriate?
Please type your answers. All work should be turned in as hard copy at the beginning of class on the due date. This homework is worth 20 points.