.

# Dynamic Programming Algorithm

Dynamic Programming is a effective technique which allows someone to resolve numerous diﬀerent kinds of problems in time O(n2) or O(n3) that the naive approach might consider exponential time.

## Steps of Dynamic Programming

- Dynamic programming requires some key methods:
- Create a mathematical notation that may convey any kind of solution as well as subsolution for the problem at hand.
- Show how the Principle associated with Optimality holds.
- Make a recurrence relation that relates that is applies a solution to be able to it is subsolutions, when using the math notation associated with step1. Indicate what the initial values tend to be that recurrence relation, as well as that phrase the final solution.
- Write an algorithm to compute the recurrence relation.

- Steps1 and Step2 need not be in that order.
- Step3 may be the heart from the design procedure. Within high level algorithmic design conditions, one can possibly stop at step3.
- Without the Principle associated with Optimality, it's not be possible in order to obtain the sensible recurrence relation within step3.
- When the Principle associated with Optimality holds, the steps4 associated with DP tend to be assured in order to yield an optimal solution.

.