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.

0 of 32 lessons passed

Start lesson 1

Lessons

Progress and your code are kept in this browser only.

  1. Halve a sorted list with binary search
  2. Meet in the middle with two pointers
  3. Slide a window over the longest unique run
  4. Merge overlapping intervals after sorting
  5. Match brackets with a stack
  6. Rotate a queue to eliminate players
  7. Build permutations by fixing one item
  8. List every subset with include or skip
  9. Insert each item into a sorted prefix
  10. Sort by splitting and merging
  11. Partition around a pivot for quicksort
  12. Reverse a linked list in place
  13. Find the middle with slow and fast pointers
  14. Trade memory for speed with a dictionary
  15. Insert into a binary search tree
  16. Delete from a binary search tree
  17. Keep a min-heap in a plain list
  18. Pick the k smallest with heapq
  19. Store words letter by letter in a trie
  20. Join sets quickly with union-find
  21. Evict the least recently used key
  22. Find the fewest steps with breadth-first search
  23. Count connected groups with depth-first search
  24. Find cheapest routes with Dijkstra's algorithm
  25. Count islands on a grid
  26. Handle negative costs with Bellman-Ford
  27. Remember answers with memoization
  28. Fill a table for the fewest coins
  29. Compare two strings with a 2D table
  30. Backtrack through N queens
  31. Never step back with Knuth-Morris-Pratt
  32. Order tasks with depth-first topological sort

All courses