Hi all,

I'm new here. I have been given a task regarding Hash tables. I have a file which contains one random number per line. I am to read the contents of the file and then hash them before finding some statistics.

Here are the requirements :

1. The hash table should be implemented as an array with 5,000 elements (buckets). Each bucket should be able to store multiple entries to handle collisions; there should be no limit on the number of entries each bucket can store. Optimize your design for fast insertions.

2. A good hashing algorithm should be chosen and implemented to ensure that each bucket has approximately the same number of entries.

3. The following statistics should be stored in the output file:

a. Total count of random numbers received by system.

b. Total time taken to insert the numbers into hash-table.

c. Average time taken to insert a number into hash-table.

d. Average number of random numbers stored in each bucket.

e. The number of entries in each bucket. The maximum and minimum should be highlighted.

I basically need to know which kinds of hashing function/algorithm will be best suited for this task.

Thanks, T.W.

I'm new here. I have been given a task regarding Hash tables. I have a file which contains one random number per line. I am to read the contents of the file and then hash them before finding some statistics.

Here are the requirements :

1. The hash table should be implemented as an array with 5,000 elements (buckets). Each bucket should be able to store multiple entries to handle collisions; there should be no limit on the number of entries each bucket can store. Optimize your design for fast insertions.

2. A good hashing algorithm should be chosen and implemented to ensure that each bucket has approximately the same number of entries.

3. The following statistics should be stored in the output file:

a. Total count of random numbers received by system.

b. Total time taken to insert the numbers into hash-table.

c. Average time taken to insert a number into hash-table.

d. Average number of random numbers stored in each bucket.

e. The number of entries in each bucket. The maximum and minimum should be highlighted.

I basically need to know which kinds of hashing function/algorithm will be best suited for this task.

Thanks, T.W.