Question: X 1 2 2 9 : Hash Function Sum Digits Write a function in Java called hashSumDigits ( ) that will take a non -
X: Hash Function Sum Digits
Write a function in Java called hashSumDigits that will take a nonnegative value to be stored in a hash table and the size of the table and returns the index where the value will be stored.
This hash function sums all the digits in the value to be stored and then returns the modulo of that sum with the size of the table.
You should use a loop to sum of all the digits. Remember that mod by yields the rightmost digit eg is while division by removes the rightmost digit eg is
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
