Recall & Review
beginner
What does the '0 1' in the 0 1 Knapsack Problem mean?
It means each item can either be taken completely (1) or not taken at all (0). No partial items are allowed.
Click to reveal answer
beginner
What is the main goal of the 0 1 Knapsack Problem?
To maximize the total value of items placed in the knapsack without exceeding its weight capacity.
Click to reveal answer
intermediate
In the dynamic programming solution of 0 1 Knapsack, what does the DP table represent?
Each cell dp[i][w] represents the maximum value achievable using the first i items with a weight limit w.
Click to reveal answer
intermediate
Why can't we use a greedy approach for the 0 1 Knapsack Problem?
Because choosing items based on value or weight alone may not lead to the optimal solution when items can't be split.
Click to reveal answer
intermediate
What is the time complexity of the classic dynamic programming solution for the 0 1 Knapsack Problem?
O(n * W), where n is the number of items and W is the maximum weight capacity of the knapsack.
Click to reveal answer
In the 0 1 Knapsack Problem, what does the '1' represent?
✗ Incorrect
The '1' means you either take the whole item or none at all.
Which approach is commonly used to solve the 0 1 Knapsack Problem optimally?
✗ Incorrect
Dynamic Programming efficiently finds the optimal solution by building up answers for smaller subproblems.
What does dp[i][w] represent in the DP table for 0 1 Knapsack?
✗ Incorrect
dp[i][w] stores the best value achievable using first i items within weight w.
What is the main constraint in the 0 1 Knapsack Problem?
✗ Incorrect
The knapsack cannot hold items exceeding its weight limit.
Why is the greedy approach not suitable for the 0 1 Knapsack Problem?
✗ Incorrect
Greedy fails when items can't be split and the best combination isn't just the highest value or lowest weight items.
Explain how the dynamic programming table is built for the 0 1 Knapsack Problem.
Think about how you decide to take or skip each item for every weight limit.
You got /4 concepts.
Describe why the 0 1 Knapsack Problem cannot be solved optimally by a greedy method.
Consider an example where picking the best item first leads to a worse total value.
You got /4 concepts.