Question
2) Hashing functions can be applied to string of characters. For example amigo and annex can be assigned hashing value 0, bike and bureaucrat can
2) Hashing functions can be applied to string of characters. For example "amigo" and "annex" can be assigned hashing value 0, "bike" and "bureaucrat" can be assigned 1, "zebra" can be assigned value 25. So in order to find the hashing value of a word, we find the hashing value of the first letter (ht(a)=0, ht(b)=1, ht(c)=2,.,ht(z)=25). So in this case it is necessary 26 buckets. a) Give an example of another hashing function on string of characters, and determine how many buckets are needed (we can assume that the maximum number of characters in a string is 6).
b) What will be an ideal function so there are not collisions (assuming that the maximum number of characters in a string is 6), and determine the how many buckets are needed
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