chevron_leftHashing All topics

Hash Map

key % 5 → bucket

  1. 0
      empty
  2. 1
      empty
  3. 2
      empty
  4. 3
      empty
  5. 4
      empty

A hash map turns a key straight into a location. Instead of searching for where something is, it calculates where it must be — so lookups are almost instant, no matter how much you store.

step 01/17

  • checking
  • collision · chained
  • placed · found

Practice

spec · json ↗