Question: How does hashing and rehasing work? 1. Given the 6 inputs 4371, 1323, 6173, 4199, 9679, 1989 for an initially empty hash table, and a

How does hashing and rehasing work?

1. Given the 6 inputs 4371, 1323, 6173, 4199, 9679, 1989 for an initially empty hash table, and a hash function h(x) = x mod 10, show the resulting hash table. State and explain

2.Show the resulting hash table for the conditions of part 1 using the hash function h(x) = 7 - (x mod 7).

3.Show the result of rehashing the hash table of part 2

Here are the values that I got for both mod 10 and mod 7. mod 10: 4371->1, 1323 ->3, 6173->3, 4199->9, 9679->9, 1989->9 mod 7: 4,7, 1,1 2, 6

Here is what I have: x mod 10: 0 1 -> 4371 2 3 ->1323 ->6173 4 5 6 7 8 9 ->4199 ->9679 ->1989 7-(x mod 7): 0 1->4199 -> 6173 2->9679 3 4->4371 5 6 ->1989 7->1323 8 9 Is this how I'm suppose do when creating hash tables? or do you do without doing a chaining table and what would it look like? How do I apply the rehashing for 7-(x mod 7)?

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!