Guided lesson

Hash Sets

Hashing

Hash Sets

Core

Mental model

  • No duplicates.

Operations

add average O(1)

Cost shape

Average O(1), worst O(n)

Watch out

Using a list for membership checks when a set is needed.

Related algorithms

DFSBFSDuplicate Detection
Guided progression
10% lesson
Step 1 / 2Learner goal
Speech settings Speed 1.0 · Volume 90%

Keyboard: Space play/pause · Arrow keys step · Page Up/Down change sections · R restart