Hashing: store data in table slot T[n], where n = Hash(key) = key mod TableSize
Solution a:
ni(x) = (Hash(x) + i) mod TableSize (i=0,1,2,...)
TableSize=16, data={1, 2, 5, 10, 17, 25, 36, 49}
Hash table using linear probing:
Solution b:
ni(x) = (Hash(x) + i2) mod TableSize (i=0,1,2,...)
TableSize=16, data={1, 2, 5, 10, 17, 25, 36, 49}
Hash table using quadratic probing:
Comments
Leave a comment