Write a program that uses a hash-coded data storage method to store the 400 items in (file400.txt). You can start with an earlier program such as the binary search lab to speed up your work.
The method of dealing with collisions should be the dynamic linked list version.
You should develop your own hashing scheme to take the key field (id) and determine the correct address.
Test your new data structure and algorithm with some sample searches. The program should prompt you for an id value and return the inv amount or a message that the id does not exist. Your instructor will specify some sample id values to test out.
Your program must analyze the efficiency of your hashing scheme by determining the following statistics about your hash table:
- The % of
null
pointers in the hash table.
- The average length of linked lists.
- The longest linked list in the hash table.
After seeing these results, you might want to try to improve upon your hashing scheme if the number of collisions is excessive.