Answer to Question #278169 in C for Amit

Question #278169

 Given a number n = abc and with the hash function f(n) = (a*30+ b*31+c*32) mod 9. Then generate the hash table by following linear and quadratic probing resolution separately for the following data set: 476,192,215,729,318,620,586,828,434.

1
Expert's answer
2021-12-11T01:58:54-0500

Data set: 476,192,215,729,318,620,586,828,434.

Getting the index of each item in the data set:


"Index\\ of\\ 476 = ( 4\\times 30 + 7 \\times 31 + 6 \\times 32) mod\\ 9 = 7\\\\\nIndex\\ of\\ 192 = ( 1\\times 30 + 9 \\times 31 + 2 \\times 32) mod\\ 9 = 4\\\\\nIndex\\ of\\ 215 = ( 2\\times 30 + 1 \\times 31 + 5 \\times 32) mod\\ 9 = 8\\\\\nIndex\\ of\\ 729 = ( 7\\times 30 + 2 \\times 31 + 9\\times 32) mod\\ 9 = 2\\\\\nIndex\\ of\\ 318= ( 3\\times 30 + 1 \\times 31 + 8\\times 32) mod\\ 9 = 8\\\\\nIndex\\ of\\ 620= ( 6\\times 30 + 2 \\times 31 + 0\\times 32) mod\\ 9 = 8\\\\\nIndex\\ of\\ 586= ( 5\\times 30 + 8 \\times 31 + 6\\times 32) mod\\ 9 = 5\\\\\nIndex\\ of\\ 828= ( 8\\times 30 + 2 \\times 31 + 8\\times 32) mod\\ 9 = 0\\\\\nIndex\\ of\\ 434= ( 4\\times 30 +3 \\times 31 + 4\\times 32) mod\\ 9 = 8\\\\"

Hash table generated by Linear Probing


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS