Tutorial by Examples

Dynamic programming solves problems by combining the solutions to subproblems. It can be analogous to divide-and-conquer method, where problem is partitioned into disjoint subproblems, subproblems are recursively solved and then combined to find the solution of the original problem. In contrast, dyn...
Let's discuss with an example. From n items, in how many ways you can choose r items? You know it is denoted by . Now think of a single item. If you don't select the item, after that you have to take r items from remaining n-1 items, which is given by . If you select the item, after that you hav...
No matter how many problems you solve using dynamic programming(DP), it can still surprise you. But as everything else in life, practice makes you better. Keeping these in mind, we'll look at the process of constructing a solution for DP problems. Other examples on this topic will help you understan...

Page 1 of 1