Algorithms practice

One page of problems per algorithms lesson, ten or so each, then three pages of hard problems that combine them. Unlike the first practice section, these are grouped by topic, because the point is to drill one pattern until it is automatic. Do a page right after its lesson, or come back and do them all in order as a review.

As before, any correct solution passes unless the statement says a check is large. Where it does, the slow approach will run out of time, and that is the exercise.

  1. Searching: 10 problems.
  2. Sorting: 10 problems.
  3. Hashing: 10 problems.
  4. Two pointers and windows: 10 problems.
  5. Linked lists: 10 problems.
  6. Trees: 11 problems.
  7. Graphs: 10 problems.
  8. Heaps: 10 problems.
  9. Greedy: 10 problems.
  10. Dynamic programming: 11 problems.
  11. Backtracking: 10 problems.
  12. Hard 1: lists, strings and search: 10 problems.
  13. Hard 2: trees, graphs and heaps: 10 problems.
  14. Hard 3: dynamic programming and backtracking: 11 problems.