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×30+7×31+6×32)mod 9=7Index of 192=(1×30+9×31+2×32)mod 9=4Index of 215=(2×30+1×31+5×32)mod 9=8Index of 729=(7×30+2×31+9×32)mod 9=2Index of 318=(3×30+1×31+8×32)mod 9=8Index of 620=(6×30+2×31+0×32)mod 9=8Index of 586=(5×30+8×31+6×32)mod 9=5Index of 828=(8×30+2×31+8×32)mod 9=0Index of 434=(4×30+3×31+4×32)mod 9=8Index\ of\ 476 = ( 4\times 30 + 7 \times 31 + 6 \times 32) mod\ 9 = 7\\ Index\ of\ 192 = ( 1\times 30 + 9 \times 31 + 2 \times 32) mod\ 9 = 4\\ Index\ of\ 215 = ( 2\times 30 + 1 \times 31 + 5 \times 32) mod\ 9 = 8\\ Index\ of\ 729 = ( 7\times 30 + 2 \times 31 + 9\times 32) mod\ 9 = 2\\ Index\ of\ 318= ( 3\times 30 + 1 \times 31 + 8\times 32) mod\ 9 = 8\\ Index\ of\ 620= ( 6\times 30 + 2 \times 31 + 0\times 32) mod\ 9 = 8\\ Index\ of\ 586= ( 5\times 30 + 8 \times 31 + 6\times 32) mod\ 9 = 5\\ Index\ of\ 828= ( 8\times 30 + 2 \times 31 + 8\times 32) mod\ 9 = 0\\ Index\ 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!
LATEST TUTORIALS
APPROVED BY CLIENTS