|
1 | 1 | # Hints
|
2 | 2 |
|
3 |
| -## A starting point: brute-force recursion |
| 3 | +## General |
4 | 4 |
|
5 |
| -If you're stuck, a good starting point is a brute-force recursive solution. |
| 5 | +- A good starting point is a brute-force recursive solution. |
6 | 6 | You can see it sketched out in the first half of the article ["Demystifying the 0-1 knapsack problem: top solutions explained"](demystifying-the-knapsack-problem).
|
7 |
| - |
8 |
| -## Dynamic programming: what is it? |
9 |
| - |
10 |
| -For a more efficient solution, you can improve your recursive solution using *dynamic programming*, which is introduced in the second half of [the above-mentioned article](demystifying-the-knapsack-problem). |
11 |
| - |
| 7 | +- For a more efficient solution, you can improve your recursive solution using _dynamic programming_, which is introduced in the second half of [the above-mentioned article](demystifying-the-knapsack-problem). |
12 | 8 | For a more general explainer, see the video ["5 Simple Steps for Solving Dynamic Programming Problems"](solving-dynamic-programming-problems)
|
13 |
| - |
14 |
| -## Dynamic programming and the knapsack problem |
15 |
| - |
16 |
| -If you need a more visual walkthrough of how to apply dynamic programming to the knapsack problem, see the video ["0/1 Knapsack problem | Dynamic Programming"](0-1-knapsack-problem). |
17 |
| - |
18 |
| -Also worth mentioning is [this answer](intuition-of-dp-for-knapsack-problem) to a question on Reddit, *"What is the intuition behind Knapsack problem solution using dynamic programming?"*. |
19 |
| -Here is the answer in full: |
| 9 | +- If you need a more visual walkthrough of how to apply dynamic programming to the knapsack problem, see the video ["0/1 Knapsack problem | Dynamic Programming"](0-1-knapsack-problem). |
| 10 | +Also worth mentioning is [this answer](intuition-of-dp-for-knapsack-problem) to a question on Reddit, _"What is the intuition behind Knapsack problem solution using dynamic programming?"_. |
| 11 | +Below is the answer in full. |
20 | 12 |
|
21 | 13 | > The intuition behind the solution is basically like any dynamic programming solution: split the task into many sub-tasks, and save solutions to these sub-tasks for later use.
|
22 | 14 | >
|
|
0 commit comments