Question: Suppose you are implementing a hash table and are trying to choose between using a probing strategy and using separate chaining ( each slot is

Suppose you are implementing a hash table and are trying to choose between using a probing strategy and using separate chaining (each slot is actually a linked list that can hold as many records as needed). You will use the same hash function and hash table size no matter which strategy you select.
i. A primary collision occurs when two records map to the same home slot in the table. Will the number of primary collisions be lower if you choose probing or if
you choose separate chaining? Justify your conclusion carefully.
[3 marks]
ii. The drawback of using separate chaining is that you will have to perform a linear traversal of the linked list to find a record, and linear traversals are slow. Assuming that a small but significant number of primary collisions will occur, would searching be more efficient if you chose linear probing instead of separate chaining? Justify your conclusion carefully.
[4 marks]
iii. Reconsider part (ii) under the assumption that you would choose quadratic probing as an alternative to separate chaining. Justify your conclusion
carefully.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!