Question: Problem(using python) a. Complete the function hashString() to take in a string, and return the string hashed according to the hashing strategy we saw in
Problem(using python) a. Complete the function hashString() to take in a string, and return the string hashed according to the hashing strategy we saw in class, where the string is treated as a base-26 number and each letter has a value (a=1, b=2 ... z=26). Example hashString("dog") returns 3101 (4*26^2 + 15*26^1 + 7*26^0) hashString("god") returns 5126 (7*26^2 + 15*26^1 + 4*26^0) b. Design your own hash function that returns a 3-digit hash value(index) for any input of number having number of digit between 4 and 10. Example: hashIndex(12345) returns a 3-digit number depending on your hash function.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
