Dynamic Programming introduction

 Explanation Video

Greedy method and Dynamic Programming both are used to solved optimisation problems. Both are different strategies but the purpose is the same.

Optimisation problems are those that requires minimum or maximum results.

In Greedy method we try to follow predefine procedure to get the optimal result since procedure is known to be optimal.

In Dynamic Programming we try to find out all possible solutions and then pick up the best solution.

Dynamic programming problems are solved using recursive formulas but it's not recursion.

Dynamic programming follow the principle of optimality. 

Principle of optimality says that the problem can be solve by taking the sequence of decisions to get the optimal result.

In Greedy method decision is taken one time and in Dynamic programming decision is taken in every stage.

Tabulation-vs-Memoization

Memoization follow top down approach


Tabulation follow bottom up approach


In Dynamic programming mostly problems are solved using tabulation.

Comments

Popular posts from this blog

SQL basic interview question

gsutil Vs Storage Transfer Service Vs Transfer Appliance