Algorithms Advanced
Go deep on searching, sorting, graphs, and dynamic programming — the advanced patterns that solve the hardest coding problems.
Curriculum (22 steps)
How a function can solve a problem by delegating a smaller version of the same problem to itself, the call stack, and common pitfalls.
Follow factorial(5) from the initial call through five stack frames, the base case at factorial(0), and the return unwinding that produces 120.
Search and sorting choices depend on what is already known about the data and what operations the product needs.
Follow the key state changes and boundary checks involved in choosing a search or sorting strategy.
An interactive concept flow for choosing a search or sorting strategy, from its assumptions through the main operation and boundary checks.
A hash table transforms a key into a hash value and uses part of that value to select a bucket or slot.
Explain the model, execution steps, complexity, and limits of hash tables: from keys to buckets.
Follow the key state changes and boundary checks involved in trees and heaps solve different ordering problems.
Explain the model, execution steps, complexity, and limits of trees and heaps solve different ordering problems.
Follow the key state changes and boundary checks involved in representing a graph before traversing it.
An interactive concept flow for representing a graph before traversing it, from its assumptions through the main operation and boundary checks.
Number of Islands
practiceCount connected land regions in a grid where horizontal and vertical neighbors connect.
Explain the model, execution steps, complexity, and limits of representing a graph before traversing it.
Coin Change
practiceFind the fewest unlimited coins needed to make amount, or -1 if impossible.
Explain the model, execution steps, complexity, and limits of choosing a search or sorting strategy.