/Dynamic-Programming

Working through some Memoization and Tabulation Examples in Python

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

Dynamic-Programming

Exploration of Dynamic Programming in Python

Source Video (in JavaScript): https://www.youtube.com/watch?v=oBt53YbR9Kk

Principles of Dynamic Programming

  1. Make it work

    1. Represent a recursive problem as a recursive tree (for Memoization) OR iterative table (for Tabulation).
    2. Implement the core recursive OR iterative logic.
    3. Validate that it works.
  2. Make it efficient

    1. Identify recursive/iterative structures/patterns.
    2. Add a memo object (dictionary in the case of Python) as an input, often defaulted to an empty dictonary {}.
    3. Add a parameter to look up existing entries in memo, only do calculations if not in memo (and return values into memo).

Warning

These are my best efforts within time constraints, scripts may not be exhaustively complete or functional.