Data structures & algorithms

Once by the book.
Once where it earns its place.

The fundamentals in their textbook form and inside a real system. Explore how a structure works, what your language already ships, and the situations where one choice earns its place over another.

Moving in. 30 of 30 topics have lessons; they're moving over from the old site.

30 topics

Moving in 30 of 30 topics have lessons, which are moving over from the old site. Planned topics show where the catalog is going.

Foundations and cost

Name the input, count the work, and keep memory honest.

Technique moving

Time and space complexity

Count repeated work and growing storage over turbine inspection cards before a small input hides the difference

TypeScriptGo
Technique moving

Recursion

Solve a nested recipe from its base case upward, then choose between the call stack and explicit frames

TypeScriptGo
Technique moving

Dynamic programming

Reuse overlapping postage subproblems with a memo or a bottom-up table, then compare the state-space cost

TypeScriptGo

Sequences and ordered work

One after another, and what it costs to reach the middle.

Structure moving

Stack

Resume nested compost-hub procedures by restoring the newest saved cursor first

TypeScriptGoRust
Structure moving

Queue and deque

Keep ballot batches in order and restore one interrupted batch at the front of a growable ring

TypeScriptGoRust
Structure moving

Ring buffer

Keep a lift station’s latest signed level offsets in fixed slots, and choose overwrite or refusal when full

TypeScriptGoRust

Lookup, membership, and eviction

Find a value, remember what you have seen, and decide what to keep.

Structure moving

Hash map

Find a film reel by normalized canister label: hash to a bucket, compare keys, and preserve lookup through growth

TypeScriptGoRust
Structure moving

Hash set

Keep a birder’s life list once each: hash a species code, probe past collisions, and leave a tombstone when you remove one

TypeScriptGo
Structure moving

Ordered map

Edit a podcast’s chapter markers: find the chapter at the playhead, jump to the next, keep markers 10 seconds apart, and list what is in view

TypeScriptGo
Structure moving

LRU cache

Resolve a café’s short links from memory: a hash map finds each link, a linked list keeps recency, the least recently used is evicted, and a changed link is invalidated

TypeScriptGo

Trees, priority, and prefixes

Keep enough order to answer a useful question quickly.

Structure moving

Binary heap

Keep the highest-priority item within reach without sorting everything

TypeScriptGoRust
Structure moving

Trie

Suggest emoji as someone types a shortcode: share prefixes, complete by popularity, prune removed codes, and weigh the cost of the nodes

TypeScriptGo
Structure moving

Binary search tree

Find a conference badge by name: branch left or right, watch a sorted export build one long branch, and rotate to keep lookups short

TypeScriptGo
Structure moving

B+ trees and indexes

Index a bakery’s orders by day: keep sorted records in linked leaf pages, split a full page and grow a new root, and read a range of days down one path and along the leaves

TypeScriptGo

Graphs and connectivity

Things that point to one another, and the ways to follow those connections.

Structure moving

Adjacency list

Map an island airline’s nonstop routes: keep each airport’s departures and arrivals as lists, check a route, close an airport, and compare with a matrix

TypeScriptGo
Structure moving

Union-find

Group duplicate photos from matching pairs: merge groups, check whether two photos belong together, and rebuild when a photo is taken out

TypeScriptGo
Technique moving

Breadth-first and depth-first search

Search a project folder: find the nearest package.json one layer at a time, add up folder sizes branch by branch, and survive a symlink loop

TypeScriptGo
Technique moving

Topological sort

Calculate an invoice sheet: order cells so each formula runs after what it reads, recalculate only what an edit reaches, and catch a circular reference

TypeScriptGo
Concept moving

Graph overview

Model a bicycle-repair cooperative’s shared parts ledger: members as nodes, debts as directed weighted edges, and balances, groups, cycles, and settlement as graph questions

TypeScriptGo

Approximate structures

Smaller memory footprints, with the uncertainty made explicit.

Structure moving

Bloom filter

Screen sign-up passwords against a common-password list: hash to a few bits, trust a no, and ask the full list only on a maybe

TypeScriptGo
Structure moving

Count-min sketch

Spot a neighborhood forum’s trending hashtags: count into a small table of counters, never undercount, and rotate each hour

TypeScriptGo
Structure moving

HyperLogLog

Count a transit line’s different riders from card taps: keep the longest run of zeros per bucket, merge stations and days, and trade 1.6% error for kilobytes

TypeScriptGo

Search, sorting, and sequence techniques

Ways to work over a sequence, and what makes each approach useful.

Technique moving

Sorting

Shelve a library’s returned books: insertion-sort small piles, merge them stably, and see why the built-in sorts work the same way

TypeScriptGo
Technique moving

Sliding window

Excerpt a product review: grow a window on the right, shrink it on the left, and keep a running summary instead of rereading

TypeScriptGo
Technique moving

Two pointers and prefix sums

Find two sorted book prices that use up a gift card exactly, and answer repeated contiguous totals with stored prefix boundaries

TypeScriptGo
Technique moving

Divide and conquer, greedy choices, and backtracking

Choose a strategy by its proof: combine backlog runs, book conservation appointments by earliest finish, and restore choices until spare workshop minutes fit exactly

TypeScriptGo
Technique moving

Monotonic stacks, interval problems, and string matching

Keep unresolved readings ordered, merge overlapping maintenance windows after sorting, and reuse pattern borders when searching logs

TypeScriptGo