1. Given the following key values, show what the data structures would look like after insertions 25 44 126 91 53 150 544 525 481 123 621 735 566 223 66 (no preprocessing necessary: pk = key)

a. Linear array of 19 elements using division hashing and the linear-quotient collision path algorithm N = 19, 4k+3 prime = 23

LQHashing:
1. ip = pk % N
2. q=pk/N
if (q%N != 0)
offset = q
else
offset = 4k+3 prime
3. While collisions:
ip’ = (ip + offset) % N
4. Set Array[ip]=key

b. Bucket hashing of 10 elements (N=10) ip = (pk) % N

2. Fill in the table based on exercise 1

Number of comparisons to retrieve this element

Key, Lineary array - (Length of Collision Path + 1), Buckets - (# of elements in linked list compared)
25
44
481
735
566
66
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.