hi I am unable to understand this approach to convert string into a key please see in the image https://pasteboard.co/JaNCmg9.png
Hash Function converting string in to a key
while calculating hashfunction our aim is to bind the string with an integer so that we can store it in array or vector
as explain in picture
you have to iterate over string and then multiply it will power of k(k can be any prime >26 let say k=37)
for bat
b37+a37^1+t*37^3
here characters(b,a,t,) are replaced by ther ascii values
now this no can exceed the size of table so for that you have to take mod with table size
i hope this help
if you have more doubts regarding this feel free to ask
if your doubt is resolved mark it as resolved from your doubt section inside your course
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.