NOTE

Dynamic Programming

Solving overlapping subproblems with memoization/tabulation by defining state, transition, initialization, and answer.

Data Structures & AlgorithmsCreated Updated 1 min readhistorical

This is a historical learning note and may contain outdated or incomplete understanding.

Dynamic programming applies when a problem has reusable overlapping subproblems and an optimal/counting structure expressible through smaller states.

A reliable workflow is:

  1. define the state precisely;
  2. derive the transition/recurrence;
  3. establish base cases and evaluation order;
  4. compute the requested result;
  5. optimize dimensions only after correctness is clear.

Top-down memoization and bottom-up tabulation are two implementations of the same state-dependency idea.

Loading helpful count