i have a confusion in hash function.
Doubt doubt doubt
what confusion are u having???
check the code…
%table_size we are doing so that idx doesn’t go out of bound
(a+b)%m = [a%m + b%m]%m == (a%m)%m + (b%m)%m…???
yes its true… u would have studied this in course itself…
idx = idx % table_size; --> why not here…in the end???
in the loop itself we are doing mod so no need when coming out of loop
i hope ur doubt is cleared now??
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.