Instructions for Machine Problem #3 -- COM1201 Sp2000 -- Professor Futrelle

Here are the source code samples I demonstrated in class and posted the next day, Friday the 26th of May:

A progress report is due on the Thursday, May 25th and the full machine problem is due on Thursday June 1st -- the last day of class.

1/3 of the MP#3 grade will be based on the Progress Report.

The goal of this machine problem can be simply stated: Build a hash table and hash function and show that you can insert and find values in the table, using a key.

This is a team project. You should work in groups of two, or possibly three students. When you hand in the progress report and the final results, you must include a statement signed by the two or three students involved as to what the division of labor was -- who did what and how much of each part of the work was done by each team member. The problem can be done on any platform you choose, Windows, Mac, Unix, Linux, etc., but the final project must be handed in on floppies that you have checked so that you know it runs on the College Windows NT systems, as a simple console application (see the instructions for such applications in connection with Lab #2.)

The general goals are for you to:

More specifically, you should proceed in the following way:

  1. Design and implement a simple hash table class.
    Use an integer key and a string value.
  2. Design and test a simple hash method function for integer keys.
  3. Design a simple linked list class structure and test it.
  4. Create a function that prints a list node and then one that prints a list.
  5. Manually attach a node to a hash array item, then a list.
  6. Design and test a function that prints out the hash table, printing out each list.
  7. Design and test an insert function that hashes the key, builds the node and inserts it.
  8. Insert a number of values and print the hash table to show that things are there.
  9. Print out the number of elements attached to each hash array element.
  10. Design and test a search function that returns a value if the value is in the table.
  11. Optional: Use a string as the key and a string or integer as the value.
  12. Optional: Read data from and print results to files so you can use larger data sets, such as file countryCodes.dat.
  13. Optional: Design a function that clears the hash table, deleting the list nodes.
  14. Comment your code. Some comments should be grouped before a class or function, others might be at the detailed code level. Please don't put one comment for every line of code. Use better judgement than that.

  15. Work on the documentation of your project, which should include what you did, how you did it, what your results were, and most importantly a discussion of your results, and conclusions. Results don't "speak for themselves"; they must be explained to be worth anything.

  16. For the details on what to hand in, in the way of floppies, hardcopies, etc., see the instructions for Lab #2.

Good Luck and enjoy the project!