File DEJAVU310. COMPSCI contains records in the following form: Columns 1 to 23 - name, columns 24 to 35 - topic. The name is broken into parts as follows: surname, one space, other names.
Use a hash table to store the information from the file. Each bucket of the table should contain one slot that holds all the information from one record of the file. Entries should be placed in the hash table using the surname only in the hash function. You may choose any hash function that was discussed in class to make the initial bucket selection for a record. However, you do not have a choice of hash table size. The hash table must have exactly 101 buckets.
Overflows must be handled by rehashing in the following way. The first rehash function (if needed) should give the ASCII value of the first character of the other names. The second rehash function (if needed) should give the ASCII value of the second character of the other names. Subsequent rehashes are handled similarly. If necessary, the characters of the other names are reused for rehashing. Remember, each rehash function value is added to the previous function.
After storing all the records from DEJAW310. COMPSCI in the hash table, read the query records in file FINDS10.COMPSCI. Each
query record consists of a name in columns 1 to 23 After reading a query record, find the associated record in the hash table. Print
the name, topic, and number of buckets checked to find the record for each query. Print an appropriate message if the name cannot
be found (include the number of buckets searched).