Hey all, I'm self studying A level computer science, but this is one topic I'm struggling to get my head around, hash tables. Here is the question I am on:
Q) Using the hashing function k(k+3) mod m, where k is the key field and m is the bucket size, if m is 251, calculate the addresses for the key fields:
a) 101
b)52
Now I understand you substitute the key field into k and 251 into m e.g. for a) 101((101+3) = 104) mod 251
=10504 mod 251
But from here I'm not sure on what I'm doing. I've done my best to try to understand the use of modular arithmetic, but I don't know how to do these questions. Can anyone help me out? Thank you in advance (the answers are 213 for a) and 99 for b) btw)