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 iea and A are the same
Hashtable Size :
Hashfunction:
Must contain two parts:
Compression : that takes the key and compresses it to a bit integer
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 character alphanumeric code converts to a key for your hashfunction.
Use the following Keys for examples:
NJGDHQQVE
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 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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
