int hashfn code part not clear
Implementation of hashtable
see if we are passing any string as key
then its hash value needs to be calculated
so in the hash fun we calculate the length of the key ie L
we iterate through the L of string
Summation of value at that index starting from left * pow of prime number
[sine we need to multiply with the power of a prime no (in this case we are taking 37 as the prime no ) ]
then so that we dont undergo overflow we take modulo
this way we get the hash value
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.