(1) Using division method for a hash function H and a hash table of size m, store your data of student IDs (n= 30) in an array of records using random generator. Record includes Student ID, and Name.

H (k) = k mod m

m : A prime number between 2**6 < m < 2**7 and not too close to the power of 2 (e.g. 79)

  • Read 30 6-digit student IDs from array of records And mapped them to hash table using linear probing
  • Print out hash table
  • Do minimum two searches one with ID found and the other one with ID not found.

(2) Using multiplication method for a hash function H and a hash table of size m, store your data of student IDs to an array of records same as in (A).

H (k) = [ m * ( k * A mod 1 ) ]
A = ( 5**(1/2) - 1 ) / 2 = 0.6180339887 (by Knuth 1973)

m : A natural number for table size ( e.g. 79)

Do (a), (b), and (c) same as in Problem (A).

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.