Skip to content

Dynamic Programming Review omits concepts taught in the lesson #71530

Closed

Description

@majestic-owl448

Describe the Issue

The Dynamic Programming Review omits concepts taught in What Is Dynamic Programming and What Are Some Common Algorithms?.

  1. The stair-counting examples lack a problem statement. The solutions section begins with:

    - **Memoization (Top-Down Approach)**: Memoization stores the results of expensive function calls and returns the cached result when the same inputs occur again.

    The memoization and tabulation examples both count ways to climb stairs, but the review never explains what n represents or that each move can climb one or two steps. Without that setup, the reason for adding the counts for n - 1 and n - 2 is missing.

  2. The time and space complexity comparison is missing. The introduction describes avoiding repeated work:

    - **Overlapping Subproblems**: The same smaller problems appear multiple times when solving the larger problem. Instead of recalculating these subproblems repeatedly, we store their solutions.

    However, the review does not compare the exponential naive recursive approach with the linear-time memoization and tabulation examples. It also omits their storage costs and the distinction between memoization's recursive call stack and iterative tabulation.

  3. The constant-space tabulation optimization is missing. The tabulation explanation says:

    - **Tabulation (Bottom-Up Approach)**: Tabulation builds the solution from the ground up, filling a table with solutions to subproblems.

    The example stores all intermediate counts in a list. The lesson also teaches that each new count depends only on the previous two values, allowing the full table to be replaced with a fixed number of variables. The review does not cover this optimization.

  4. The minimum-coin algorithm is missing. The applications section includes:

    - **Resource Allocation**: The knapsack problem and its variants appear in scheduling, budgeting, and resource management.

    It lists applications but does not summarize the lesson's worked coin change algorithm. This leaves out the minimum-coin recurrence, initialization, unreachable-amount handling, and complexity. For example, the lesson uses denominations [1, 3, 4] and a target of 6, where the minimum is two coins (3 + 3).

Affected Pages

https://www.freecodecamp.org/learn/python-v9/review-dynamic-programming/review-dynamic-programming

Expected behavior

  1. The review should introduce the staircase problem before its solutions: for a positive number of steps n, count the distinct ways to reach the top when each move climbs one or two steps.

  2. The review should compare the O(2^n) time upper bound for naive stair-counting recursion with O(n) time for memoization with an initially empty cache and for tabulation. It should explain the O(n) space used by the memo dictionary and recursive call stack, or by the tabulation list, and that iterative tabulation avoids recursive stack growth.

  3. The review should explain and briefly demonstrate retaining only the previous two stair counts. It should summarize the lesson's O(n) time and O(1) auxiliary-space analysis for this optimization.

  4. The review should summarize the minimum-coin algorithm with a concise example. It should explain the zero-amount base case, infinity for initially unreachable amounts, minimizing dp[i - coin] + 1 over eligible denominations, and returning -1 when the target remains unreachable. It should include the taught O(amount * number_of_coins) time and O(amount) space complexity.

Activity

  1. added
    help wanted
    scope: curriculum
    python v9 cert
    on Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedpython v9 certscope: curriculum

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions