CS 2401 Assignment #10

Due Date: Wednesday, May 4 or Thursday, May 5, depending on the day of your lab.

Objective: The goal of this assignment is to practice hash functions.

Background: Background: Section 20.1 of the textbook has three examples of hash functions:

The objective of this lab is to provide experimental confirmation of these claims.

Assignment: In this assignment, you will use techniques for measuring computation time that you learned in Assignment 3. For input for each hash function, you will use 100 randomly generated strings of length 8. The table size should be 10,000.

Part 1: Run the first two algorithms on 100 randomly generated strings of size 8. Compute the average running times of both algorithms and determine if the second algorithm is indeed faster.

Part 2: Run the third algorithm on 100 randomly generated strings of size 8. Count how many hash values fall within intervals from 0 to 1,000, from 1,001 to 2,000, from 2,001 to 3,000, ..., through 9,001 to 10,000. Determine whether the distribution is uniform.