Next Hash Hash Hash 27

How hashes work

first_name["Hamilton"] = "Margaret"

  • Map the key somehow to an index I from 0 … N-1

  • Store key and value in slot I of an N-element array

    • Array access is very fast!

  • Fetch and store are both constant time!

    • (Well, actually…)


Next 27