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.
Preparing for interviews? The ten-week plan puts this in order with DSA and the design rounds.
Included with a plan
This lab is part of a plan.
A plan opens every lesson, board, video, lab and paper on chalk. Yearly is $39/year.
See plansAlready a member? Sign in
Or start free: a free account opens lessons 2 and 3 of every track.
the lesson Foundations #04: Hashing (O(1) "yaad")
The whole idea this lab came from, told start to finish.
on the path Module 4 of 11 in DSA: DSA, in Hinglish
The lessons, boards and videos around this lab, in reading order.