Skip to content

Latest commit

 

History

History
6 lines (5 loc) · 760 Bytes

File metadata and controls

6 lines (5 loc) · 760 Bytes

knapsack_dynamic_programming

Dynamic programming: the knapsack problem

Algorithms help us solve problems. There are many ways to design them, a method that I did not know until recently and that has been very interesting to know is the dynamic programming. The fundamental idea of ​​dynamic programming is to divide the problem into subproblems and then calculate each subproblem once. There are two approaches: top-down and bottom-up. Dynamic programming allows us to solve problems faster than with brute force, spending much more computer memory instead.

As explained thus, it is a little abstract, we are going to try to solve a classic dynamic programming problems, the knapsack problem (or the knapsack).