Week 6 > Dynamic Programming > Knapsack Flashcards
1
Q
What is the knapsack problem definition?
A
2
Q
- What are the knapsack problem variations?
- In which knapsack problem variation greedy algorithm does not work?
A
2. Gree does not work for discrete knapsack! will design a dynamic programming solution.
3
Q
Can you provide the solution of 1. w/o repeats; 2. with repeats?
A
4
Q
A
- Greedy Solution: $30 -> 6 kg and $14 -> 3 kgs
- Optimal Solution: $30 -> 6 kg and $16 -> 4 kgs
- Since the total value of greedy solution = $44 while the optimal solution is $46
5
Q
A