Data Structures19 sections · 729 units
Open in Course

Intro

O(1) lookups

What if you could check "have I seen this element before?" in constant time? That's what hash tables give you.

In this section, you'll learn hash sets and hash maps, then learn the patterns that make them powerful: frequency counting, two-sum, and prefix sum combinations. By the end, you'll recognize when a problem that looks O(n2)O(n^2) you can solve in O(n)O(n) with the right data structure.