Here is a quote from some lecture on teh topic. I do not understand this part h : {1,...,M} -> {0,...,m-1} (the notation). Could someone please explain what it means? E.g. “a hash function h selected from M hash function, which returns values between 1 and m-1”??
Thanks.
Hashing
We assume that all the basics about hash tables have been covered in 61B.
We will make the simplifying assumption that the keys that we want to hash have been
encoded as integers, and that such integers are in the range{1,...,M}. We also assume that
collisions are handled using linked lists.Suppose that we are using a table of size m, that we have selected a hash function
h : {1,...,M} -> {0,...,m-1}and that, at some point, the keysY1,...,Ynhave been
inserted in the data structure, and that we want to find, or insert, or delete, the key x.
The running time of such operation will be a big-Oh of the number of elements Yi such that
h(yi) = h(x).………..
………..
Source: http://www.cs.berkeley.edu/~luca/cs170/notes/lecture9.pdf
It says: h is a function from the input set {1,…,M} to the target set {0,…,m-1}
More specifically it doesn’t say how the function is formed.
It simply says that it deals with certain range of inputs and some other range of outputs and that it exists.
EDIT: it’s a function, not a relation.