What is dynamic programming and how can we learn it? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 4

What is dynamic programming and how can we learn it?

18th Jun 2017, 1:15 PM
Deepthi Vemula
Deepthi Vemula - avatar
5 Answers
+ 3
will memory become any issue if it takes a large values? how can a question be identified as a DP question and how can we create a pattern to come up with a solution ?
19th Jun 2017, 7:52 AM
Deepthi Vemula
Deepthi Vemula - avatar
+ 2
ask google about it.
6th Jul 2017, 10:16 AM
Phoenix
Phoenix - avatar
+ 1
Dynamic programming approach is similar to divide and conquer in breaking down the problem into smaller and yet smaller possible sub-problems. But unlike, divide and conquer, these sub-problems are not solved independently. Rather, results of these smaller sub-problems are remembered and used for similar or overlapping sub-problems. Dynamic programming is used where we have problems, which can be divided into similar sub-problems, so that their results can be re-used. Mostly, these algorithms are used for optimization. Before solving the in-hand sub-problem, dynamic algorithm will try to examine the results of the previously solved sub-problems. The solutions of sub-problems are combined in order to achieve the best solution.
19th Jun 2017, 5:29 AM
Raghunath
Raghunath - avatar
+ 1
With regards of pattern to come up with a solution if I'm not wrong there is not a general approach but the formula for every subproblem is specific for every problem to solve.
26th Apr 2018, 6:32 AM
Ludovico Iommi
Ludovico Iommi - avatar
0
That's a good point, computational efficiency of dynamic programming has a price, its memory space consumption.
26th Apr 2018, 6:29 AM
Ludovico Iommi
Ludovico Iommi - avatar