AlgoViz

Hash usage

easy 16 min

Hash maps and hash sets find a key by computing where it lives instead of searching for it, so insert, lookup and delete cost O(1) on average.

Check yourself

One question at a time. Each answer explains why.

Question 1 of 10

Score 0
conceptual

What is the average time complexity of a hash table lookup?

Pick an answer to see why.

Flashcards

Say your answer, then reveal it.

Card 1 of 11

Recall

Average and worst-case cost of dict insert, lookup and delete?

Say your answer, then reveal it.

These cards come back in Today, just before you would forget them.