3 Hash function

A hash function is a function that maps all possible key values to some range of integers. If we use K to denote the set of all possible key values, V be a set of some finite range of integers, then a hash function h is h K × V , or h : K V .

There is no special requirement for a hash function h. It does not need to be injective. This means two key values may map to the same integer value. It also does not need to be surjective. This means that not all integer values in V may be used.