ANIMATIX WALKTHROUGH · DATA STRUCTURES
A hash table is the fundamental associative data structure of modern computing: the hash decides where a key lives, so finding it later needs no search. Eight buckets, letter sum modulo arithmetic, collision chaining, and instant probe hits and misses.
Watch keys hash into position, collide and form linked bucket chains, and retrieve in constant time with deterministic mathematical indices.
Arithmetic maps "cat" (0), "dog" (2), and "sun" (6) directly into buckets.
"owl" collides with "dog" at bucket 2 and links below without corruption.
Queries compute bucket index directly, verifying keys with 1 or 0 hops.
Add letter positions (a=1, b=2, …), then take mod 8.
cat = 3+1+20 = 24 mod 8 = 0.
The hash dictates where a key resides, eliminating scan overhead.
With unbounded keys and finite buckets, collisions are mathematically inevitable.
owl hashes to bucket 2 where dog already lives.
The bucket quietly forms a linked list, degrading to a 2-item traversal rather than failing.
Retrieval runs the ingestion logic in reverse: query sun hashes to 6 (immediate hit),
query owl checks bucket 2 and traverses the link (chained hit),
and query cow checks bucket 1 (empty slot, immediate O(1) miss).