Question
Suppose you need to insert unique 3-character IDs into a hash table, where each ID is made up of some combination of two of the
Suppose you need to insert unique 3-character IDs into a hash table, where each ID is made up of some combination of two of the capital letters A-D, followed by one ofthe lower case letters x-z, such as: ABx, DCy, BBz, etc. Repeat letters are allowed in an ID.
1. There are 48 possible codes: 4 * 4 * 3
2, The table only needs to be size 24 in order to ensure that no bucket exceeds two codes at a given time.
There are many possible ways to write the hashCode function for these IDs. Develop a correct hash function which will have each ID colliding with at most one other ID
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started