Study this topic

Dynamic Programming Fundamentals

Dynamic programming (DP) solves an optimisation (or counting) problem by combining answers to smaller overlapping subproblems. Where plain recursion recomputes the same subproblem many times, DP stores each answer once and reuses it.

Short notes10 min read

DP on Sequences: LCS, Edit Distance and LIS

Three classical DP problems act on sequences: the longest common subsequence (LCS) of two strings, the edit distance (Levenshtein distance) between two strings, and the longest increasing subsequence (LIS) of one sequence.

Short notes7 min read

Dynamic programming cheat sheets

One-page visual sheets for this topic, in the sheet library on the store. Previews are free; the full sheets come with the subject pack.

Cheat sheets3 sheets