Given the hash function h(k) = k mod 12, answer the following question on hashing (Note: Read both questions at once bef
Posted: Tue Jul 05, 2022 10:26 am
Given the hash function h(k) = k mod 12,answer the following question on hashing (Note: Read bothquestions at once before beginning).
Given the hash function h(k) = k mod 12,answer the following question on hashing
a) Insert the following keys into the hash table below. Usethe linear probing collision resolutiontechnique when appropriate. Note: Implementation of thistechnique includes wrapping around the array when you run out ofslots at the end.
Insert keys *: 18, 41, 22, 44, 58, 32, 34
Remove keys *: 22
Insert keys *: 73, 20
(*Assume associated values will be added/removed; forsimplicity we’re leaving that out.)
b) How many keys (in total) and whichones caused an initial collision when being inserted (listthem with commas)? __________
(Note, count only the initial collision if there is one.Don’t count subsequent collisions to place the key.)
Given the hash function h(k) = k mod 12,answer the following question on hashing
a) Insert the following keys into the hash table below. Usethe linear probing collision resolutiontechnique when appropriate. Note: Implementation of thistechnique includes wrapping around the array when you run out ofslots at the end.
Insert keys *: 18, 41, 22, 44, 58, 32, 34
Remove keys *: 22
Insert keys *: 73, 20
(*Assume associated values will be added/removed; forsimplicity we’re leaving that out.)
b) How many keys (in total) and whichones caused an initial collision when being inserted (listthem with commas)? __________
(Note, count only the initial collision if there is one.Don’t count subsequent collisions to place the key.)