The Runtime Theory
hard · 24h · 22 steps

Algorithms Advanced

Go deep on searching, sorting, graphs, and dynamic programming — the advanced patterns that solve the hardest coding problems.

Curriculum (22 steps)

1

How a function can solve a problem by delegating a smaller version of the same problem to itself, the call stack, and common pitfalls.

Start→
2

Follow factorial(5) from the initial call through five stack frames, the base case at factorial(0), and the return unwinding that produces 120.

Start→
3

Search and sorting choices depend on what is already known about the data and what operations the product needs.

Start→
4

Follow the key state changes and boundary checks involved in choosing a search or sorting strategy.

Start→
5

An interactive concept flow for choosing a search or sorting strategy, from its assumptions through the main operation and boundary checks.

Start→
6

Return the index of target in a sorted array, or -1 when it is absent.

Start→
7

A hash table transforms a key into a hash value and uses part of that value to select a bucket or slot.

Start→
8

Explain the model, execution steps, complexity, and limits of hash tables: from keys to buckets.

Start→
9

A search tree organizes keys so comparisons guide a search toward one subtree.

Start→
10

Follow the key state changes and boundary checks involved in trees and heaps solve different ordering problems.

Start→
11

LRU Cache

practice

Implement get and put in constant average time while evicting the least recently used key at capacity.

Start→
12

Explain the model, execution steps, complexity, and limits of trees and heaps solve different ordering problems.

Start→
13

A graph models entities as vertices and relationships as edges.

Start→
14

Follow the key state changes and boundary checks involved in representing a graph before traversing it.

Start→
15

An interactive concept flow for representing a graph before traversing it, from its assumptions through the main operation and boundary checks.

Start→
16

Count connected land regions in a grid where horizontal and vertical neighbors connect.

Start→
17

Explain the model, execution steps, complexity, and limits of representing a graph before traversing it.

Start→
18

An analysis begins by naming the input size and the operation whose growth matters.

Start→
19

Count paths to stair n using one- or two-step moves.

Start→
20

House Robber

practice

Choose nonadjacent houses to maximize the collected value.

Start→
21

Coin Change

practice

Find the fewest unlimited coins needed to make amount, or -1 if impossible.

Start→
22

Explain the model, execution steps, complexity, and limits of choosing a search or sorting strategy.

Start→