Question: Please use java to finish, thank you. CSCI 2110 Data Structures and Algorithms Laboratory No. 8 Week of November 20th, 2017 This is technically your


Please use java to finish, thank you.
CSCI 2110 Data Structures and Algorithms Laboratory No. 8 Week of November 20th, 2017 This is technically your last lab in CS 2110. Next week's lab will be a makeup one Deadline for submission: Sunday, November 26", 2017, 11.55 P.M Review of hashing (from the lectures): A hash table is a simple array structure. Whenever a key needs to be mapped onto the hash table, it uses a hash function. A common hash function used is key%table-size For example, if the table_size is 10 keys are 1008, 2540, 3467 and 789, they get mapped to locations 8, 0, 7 and 9, respectively However, multiple keys may map to the same location. For instance, in the above example, 3467 and 2487, will both map to location no. 7. A hash collision is said to occur. One way of resolving a hash clash is called separate chaining. Rather than storing the keys in the array, each array location contains a linked list. The keys are stored in the linked list. The following is an example in which 15 keys 3527,7013, 2681, 7866, 8044, 1688, 5877, 1422, 3194, 4614, 2852, 155, 2111, 3691, and 378 are mapped onto a table of size 10 0 Empty ->3691--2111->2681 -->2852- 1422 ->7013 4614--3194 ->155 ->7866 >5877--3527 >378--1688 Empty 4 8044 7 In the above example, the number of times a collision has occurred is 7. The longest linked list has a size of 3 We say that the hash table has a load factor of 15/101.5 (Load factor-number of keys mapped/table size. Note that this is not integer divistion)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
