Subtopic 9.1
Hash Functions
4lessons23 min0done
A hash function turns a key into an index of the table. A good function is quick to compute and spreads the keys evenly over the table; a bad one piles them into a few cells.
The subtopic covers the division, multiplication, folding and mid-square methods for numbers and polynomial hashing for strings. The last lesson shows why collisions cannot be avoided and introduces the load factor, which measures how full the table is.