Dynamic Programming Flashcards

1
Q

DP

A

We can apply DP in following patters

  • Overlapping subproblems
    • if we solve the problem by solving subproblems, we can reuse the already solved subproblem solution.
  • Optimal structure
    • while solving the subproblem, we can choose the efficient/option solution of subproblem to solve the bigger problem.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Data structure/Methods to use

A
  • Memoization ( Top -Down approach)
    • build solution and store the results as we solve.
      -Tabulation ( Bottom -Up approach)
      build solution from lower level and store the results.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly