Assume a set of 5-digit integer numbers have been given as the key values. The goal of this experiment is comparing the performance of double hashing with linear probing.

  • Generate 1000 random numbers in the range of 10000 and 99999 as your key set
  • For linear probing choose appropriate h() function and m parameter
  • For double hashing choose h1() and h2() functions and m parameter
  • Create hash tables using both methods
  • Count the number of collisions in each method.

Discuss the advantages of each method. For instance, we may consider clustering as a metric to compare the two methods (you do not need to include it here)

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.