Skip to content
Data Structures and Algorithms / Algorithm Design Paradigms

Dynamic Programming: The SRBOT Recipe

The previous lesson showed 0/1 knapsack defeats greedy because taking an item permanently consumes capacity in a way that can't be undone or exchanged. Dynamic programming (DP) is the paradigm built exactly for this situation: problems with overlapping subproblems (unlike divide-and-conquer's independent ones) and optimal substructure, solved by computing each distinct subproblem's answer exactly once and reusing it. This note gives a concrete, repeatable recipe — SRBOT: Subproblem, Recurrence, Base cases, Order of evaluation, Top-down vs. bottom-up — and works it in full on the classic rod-cutting problem, already having previewed the recurrence style in Floyd-Warshall.

In this lesson

  1. Learning objectives
  2. Overlapping subproblems vs. independent subproblems
  3. The SRBOT recipe
  4. Worked example: rod cutting
  5. Top-down vs. bottom-up

Before you start

The full lesson, with worked examples and exercise solutions, is for members.

Read the full lesson

New to SelfMadeQuant.com? See membership options or explore the curriculum.