Hashing Lab 1. Given the following key values, show what the data structures wou
ID: 3675682 • Letter: H
Question
Hashing Lab 1. Given the following key values, show what the data structures would look like after insertions 66 47 87 90 126 150 145 153 177 285 393 467 566 620 735 (no preprocessing necessary: p,- key) a. Linear array of 19 elements using division hashing b. Bucket hashing of 10 elements and the linear-quotient collision path algorithm N= 19, 4k+3 prime-23 Array: Array: LOHashing if (q%N != 0) offset-q else offset = 4k+3 prime 3. While collisions = (IR+ offset) % N 10 4. Set Array[1R]=key 12 13 14 15 16 17 18Explanation / Answer
The values are
66 20(19+1) 7(6+1)
467 21 8(7+1)
566 22 9(8+1)
735 23 10(9+1)
285 24 11(10+1)
87 25 12(11+1)
In the question given,
buckets = no.of elements in the linked list compared+1
=6(those are, 66,467,566,735,285,87,total becomes 6)+1
=7
that's how the program works.
linear array = (length of collision path+1)
= 19+1=20
In this manner the vaslues will be filled up in the above given table.
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.