Solution 8
Solution 8
Assigned: Thursday November 18, 2010 Due: Monday November 22, 2010 by 11:59pm
(10 points) What are the advantages and disadvantages of Open Addressing and Separate Chaining
collision resolution strategies?
Advantages Disadvantages
Open Addressing • Memory Efficient – stores • Creates Clusters with Linear and
elements in empty array Quadratic Probing
spaces
Separate Chaining • Very Easy to implement • Memory Inefficient – requires a
secondary data structure to store
collisions
• Long Chains will produce Linear
search times
(10 points) Given input {4371, 1323, 6173, 4199, 4344, 9679, 1989} and a hash function
h x =x mod 10 , show the resulting Hash Table using a secondary hash function
h 2 x =7 – x mod 7
=656/1009=0.650148662
1 1 1 1 1
probes= 1 2
= 1 2
= 18.1702044=5
2 1− 2 1−0.650148662 2