Syntax error Hash Tables for Integer Keys in Data Structure

Hash Tables for Integer Keys in Data Structure



Here we will discuss about the Hash tables with the integer keys. Here the key values ? comes from universe ? such that ? = {0, 1, … , ? – 2, ? – 1}. A hash function is ?. The domain of this hash function is ?. The range is in the set {0, 1, … , ? – 1}, and ? ≤ ?.

A hash function h is said to be a perfect hash function for a set ? ⊆ ? if for every ? ∈ ?, ?(?) is unique. A perfect hash function ? for ? is minimal if ? = |?|. So ? is bijection between S and {0, 1, … , ? – 1}. Obviously a minimal perfect hash function is desirable since this allows us to store all the elements of S in a single array of length n.

Unfortunately, perfect hash functions are very rare, even if m is much larger than n. If each element in S is uniformly and independently mapped to a random element in {0, 1, … , ? – 1}, then according to birthday paradox if m is much less than n2 then there will almost surely exists two elements of S, that have the same hash value.

Updated on: 2020-08-10T09:18:22+05:30

379 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements