redcican / Dynamic-Programming

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Memorization Recipe

1. Make it work.

  • Visualize the problem as a tree
  • Implement the tree using recursion
  • Test it

2. Make it efficient

  • Add a memo object
  • Add a base case to return memo values
  • Store return values into the memo

Tabulation Recipe

  • visualize the problem as a table
  • size the table based on the inputs
  • initialize the table with default values
  • seed the trivial answer into the table
  • iterate through the table
  • fill further positions based on the current position

About


Languages

Language:JavaScript 67.6%Language:Python 32.4%