CS 302 Assignment 5: Hash Table

Due date: Friday, October 12, 2018, midnight.

  • The assignment is to implement a hash table whose items are integers. Implement a hash table of size 17 as an array of linked lists.
  • The hash value of an integer i is i % 17.
  • Insert the numbers in the file middata into the hash table.
  • Display the contents of the hash table.
  • Delete the numbers in the file deletedata from the hash table.
  • Display the contents of the hash table.
  • Your program should ask to enter the names of the files to read, as well as the name of the file to hold the output.
  • Redo the assignment, using 197 instead of 17 for both the table size and the hash function.
  • Insert the numbers in the file bigdata.
  • Display the contents of the hash table.
  • The average size of a bucket is 1, but the buckets actually have a distribution of sizes. Expected number of buckets of various sizes.
  • Delete the numbers in the file bigdeletedata from the hash table. Display the contents of the hash table.
  • Here is my session using the small file. and deleting the numbers in the file deletedata
  • Output.