Index

DSA · Hashing: collisions

O(1) yaad

A hash map answers in one step on average. What is the worst case, and when does it start to matter?

Every key gets turned into a number, and that number picks a peg to hang it on. The same 276 words go in every time, and the panels report what an average lookup costs, what the unluckiest key costs, and which pegs are carrying a crowd. Crowd the table and watch the two costs pull apart.

Board: Hashing — O(1) Yaad →

Three panels, a slider and two rows of tabs. On a narrow screen the panels stack. Nothing animates or plays on its own.

try this Choose Add up the letters, drag Keys per peg to the right, and watch the worst key number under What a lookup costs.

Included with a plan

This lab is included with a plan. The first three lessons of every track are free, with their boards and videos. A plan unlocks every lesson, board, video, lab and paper for one price.

View plans →Already a member? Sign in