an array

Please Answer as soon as possible. Thank you so much. 5. Below is an array with…

5. Below is an array with 15 positions, which is used as a hash table to keep some IDs. The key to each record is the 3-digit
Please Answer as soon as possible. Thank you so much.
5. Below is an array with 15 positions, which is used as a hash table to keep some IDs. The key to each record is the 3-digit customer’s ID. The hash function h gives the index of the slot in the array for the key k: h(k)=%15. The method of collision resolution is double hashing. Hence, if collision happens, we repeatedly compute (h(key) + iha(key)) mod 15, for i from 1 to 15, and he(key) = key%7 until an empty position is found (for adding an item to the hash table), or the key is matched (for retrieving an item from a hash table, given a key). Add the following keys to the hash table and show your calculations: 17, 42, 189, 24, 120, 78, 114, 146,282. The first four insertions are already made and calculations are shown. 1 0 24 2 3 4 5 6 7 8 17 10 11 9 189 12 13 14 42 h(17) = 17 mod 15 = 2, hence 17 goes to position 2 h(42) = 42 mod 15 = 12, hence 42 goes to position 12 h(189) = 189 mod 15 =9, hence 189 goes to position 9 h(24) = 24 mod 15 =9, hence 24 should go to position 9, but it is already taken. Applying double hashing: for i = 1: (h(24) +1.h2(24)) mod 15 = (9+3) mod 15 12, but this slot is taken as well, hence for i = 2: (h(24) +2.h2(24) mod 15 = (9+2.3) mod 15 = 0, this slot is not taken yet, use it.