/DP

dynamic programming questions

Primary LanguageJavaScript

these are the practice questions done while learning dynamic programming-

how to think:-

  1. Make the Code run using basic recursion
  2. Optimise the code i.e. then use memoization to store data and fetch it so that we dont perform recursion for the already solved sub-problems.

it's best to make tree like structure on a piece of paper and find the patterns then make the base cases do the recursion pass memo object into the function to store the data make the base case for the memo obj i.e. to check if that sub-problem exist in memo obj or not make the storing logic for the memo obj

DP problems are generally canSum -> DECISION PROBLEM howSum -> COMBINATORIC PROBLEM bestSum -> OPTIMISATION PROBLEM