2 Suppose an online retailer identifies each member with a 6

2) Suppose an online retailer identifies each member with a 6-digit account number. Define the hashing function h, which takes the first 3 digits of an account number as 1 number and the last 3 digits as another number, adds them, and then applies the mod-61 function. (30 points)

a) How many linked lists does this create?

b) Compute h(158686)

c) Compute h(328981)

Solution

a)

h(158686)=(158+686)(mod61)

=(844)(mod61)

=(739+51)(mod61)

=((61*13)+51)(mod61)

=51

b)

h(328981)=(328+981)(mod61)

=(1309)(mod61)

=(1281+28)(mod61)

=((21*61)+28)(mod61)

=28

2) Suppose an online retailer identifies each member with a 6-digit account number. Define the hashing function h, which takes the first 3 digits of an account

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site