Algorithms & projects · Course 1 of 3
Algorithms and data structures
Searching, sorting, stacks, trees, heaps, graphs, dynamic programming and backtracking, one idea per lesson, each with a Lab that traces it step by step.
- 32 lessons
0 of 32 lessons passed
Lessons
Progress and your code are kept in this browser only.
- Halve a sorted list with binary search
- Meet in the middle with two pointers
- Slide a window over the longest unique run
- Merge overlapping intervals after sorting
- Match brackets with a stack
- Rotate a queue to eliminate players
- Build permutations by fixing one item
- List every subset with include or skip
- Insert each item into a sorted prefix
- Sort by splitting and merging
- Partition around a pivot for quicksort
- Reverse a linked list in place
- Find the middle with slow and fast pointers
- Trade memory for speed with a dictionary
- Insert into a binary search tree
- Delete from a binary search tree
- Keep a min-heap in a plain list
- Pick the k smallest with heapq
- Store words letter by letter in a trie
- Join sets quickly with union-find
- Evict the least recently used key
- Find the fewest steps with breadth-first search
- Count connected groups with depth-first search
- Find cheapest routes with Dijkstra's algorithm
- Count islands on a grid
- Handle negative costs with Bellman-Ford
- Remember answers with memoization
- Fill a table for the fewest coins
- Compare two strings with a 2D table
- Backtrack through N queens
- Never step back with Knuth-Morris-Pratt
- Order tasks with depth-first topological sort