Week 6 Discussion Forum

Dynamic Programming

Dynamic Programming

by Md Sabbir Hossain 192-15-2840 -
Number of replies: 0

Dynamic Programming is mainly an optimization over plain recursion. Wherever we see a recursive solution that has repeated calls for same inputs, we can optimize it using Dynamic Programming. The idea is to simply store the results of subproblems, so that we do not have to re-compute them when needed later. This simple optimization reduces time complexities from exponential to polynomial. For example, if we write simple recursive solution for Fibonacci Numbers, we get exponential time complexity and if we optimize it by storing solutions of subproblems, time complexity reduces to linear. Dynamic programming is a method for solving complex problems by breaking them down into simpler subproblems. It is applicable to problems exhibiting the properties of overlapping subproblems and optimal substructure. The key idea behind dynamic programming is quite simple. In general, to solve a given problem, we need to solve different parts of the problem, called subproblems, then combine the solutions of the subproblems to reach an overall solution.

161 words