Question: Write an Efficient Hashfunction for the following conditions. Keys: Varying Character Length , Alphanumeric ( can be all numbers and all letters also, case does

Write an Efficient Hashfunction for the following conditions.
Keys:
Varying Character Length , Alphanumeric (can be all numbers and all letters also, case does not matter i.e.'a' and 'A' are the same)
Hashtable Size : 15
Hashfunction:
Must contain two parts:
1. Compression : that takes the key and compresses it to a 32 bit integer
2. Hash function : that uses the hashcode from above compression and disperses it evenly across the hashtable.
The Hashfunction must follow all properties given in the Hashtables slides in modules.
Provide examples of how a 10 character alphanumeric code converts to a key for your hashfunction.
Use the following Keys for examples:
1.9242064424678123
2.9NJGDHQQV8E
3.ALTEBUERIO
Collision Strategy:
Try your best to avoid collisions with your hashfunction. If a collision occurs, write an effective strategy as a function in your program to combat it.
If a collision does not occur in the above three examples, provide example of 2 keys where collisions occur and show how your collision strategy works.
Turning it in:
Modify the cpp file and turn it in.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!