Introduction to Algorithms. Jiafen Liu. Sept. 2013. Today’s Tasks. Hashing Direct access tables Choosing good hash functions Division Method Multiplication Method Resolving collisions by chaining Resolving collisions by open addressing. Symbol-Table Problem.
if x∈S and key[x] = k,
Θ(1 + α)
apply hash function and access slot
search the list
h(k) = k mod m.
Ignored by rsh
Ignored by mod
universe of keys probe number slot number
h(k,i) = (h(k,0) +i) mod m
h(k,i) = ( h1(k) +i⋅h2(k) ) mod m
E[number of collisions with x] < n/m.
and since x0≠ y0, an inverse (x0– y0)–1 must exist, which implies that