Given the hash function h(k) = k mod 12, answer the following question on hashing (Note: Read both questions at once bef

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Given the hash function h(k) = k mod 12, answer the following question on hashing (Note: Read both questions at once bef

Post by answerhappygod »

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.)
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply