js401-reading

Hash Tables

resources

Terminology

why?

what?

example

["Greenwood:98103", "Downtown:98101", "Alki Beach:98116", "Bainbridge Island:98110", ...]

Structure

hasing

creating a hash

Key = "Cat"
Value = "Josie"
67 + 97 + 116 = 280
280 * 599 = 69648
69648 % 1024 = 16
Key gets placed in index of 16.

collisions

saving to hash table

reading from hash table

Load Factor

Hash Table Methods

Add

Find

contains

GetHash