Learning Roadmap — Recursion and Dynamic Programming


This page provides a learning path through recursion and dynamic programming (DP) for studying algorithms and preparing for competitive programming contests.
Start with the fundamentals of recursion, then move on to dynamic programming and its most important problem-solving patterns.

Choose the topic you need or follow the recommended path from beginning to end.



□ 1. Recursion Fundamentals


Recursion is a technique in which a function calls itself. To understand recursive algorithms, you need to recognize the base case, the recursive step, and how a problem is gradually reduced to smaller or simpler subproblems.

Learning goal: understand how recursive calls work, why a base case is necessary, and how the sequence of calls eventually produces a result.



□ 2. Introduction to Dynamic Programming


Dynamic programming is useful when a problem can be divided into subproblems whose results are reused. Instead of solving the same subproblem repeatedly, we can store its result and use it whenever it is needed again.

Key concepts: subproblems, memoization, overlapping subproblems, and calculating results from previously computed values.

Recommended order: Introduction to Dynamic Programming → The Fibonacci Sequence, Memoization and DP.



□ 3. Basic Dynamic Programming Patterns


These classic problems help you learn how to define DP states, establish initial values, and calculate transitions between states.

What to focus on: identify what each DP state represents, determine how it can be calculated from previous states, and understand how the states combine to produce the final answer.



□ 4. Advanced DP Patterns and Applications


After mastering the basic patterns, move on to problems that require more careful state design, transitions, or representation of subproblems.

Learning goal: understand how dynamic programming can be applied to different problem structures, including paths through a grid, selecting coin denominations, and transforming one string into another.



□ 5. Recommended Learning Order


  1. Recursive Algorithms
  2. Introduction to Dynamic Programming
  3. The Fibonacci Sequence, Memoization and DP
  4. The Knapsack Problem
  5. Subset Sum
  6. LCS — Longest Common Subsequence
  7. Grid Dynamic Programming
  8. Coin Change
  9. Edit Distance

Recommendation: do not focus only on memorizing solutions. For each problem, try to determine the DP state, initial values, transition rules, and order of computation yourself. Then test your approach on small examples.



□ What Comes Next?


After completing these lessons, practise recognizing when dynamic programming can be applied to a new problem. A useful exercise is to compare a basic recursive solution, a solution with memoization, and an iterative DP solution.

⭐ These lessons provide a foundation for studying more advanced algorithms and preparing for competitive programming contests.