Recall & Review
beginner
What is the main goal of the 0 1 Knapsack Problem?
To select items with given weights and values to maximize total value without exceeding the knapsack's weight capacity.
Click to reveal answer
beginner
In the 0 1 Knapsack Problem, what does the '0 1' mean?
Each item can be either taken (1) or not taken (0); partial items are not allowed.
Click to reveal answer
intermediate
What is the time complexity of the 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
intermediate
What does the DP table represent in the 0 1 Knapsack Problem?
It stores the maximum value achievable using the first i items with a weight limit j.
Click to reveal answer
intermediate
How do you decide whether to include an item in the knapsack during the DP solution?
Compare the value of including the item (value + best value for remaining weight) with excluding it, and choose the maximum.
Click to reveal answer
What does the 'weight capacity' in the 0 1 Knapsack Problem represent?
✗ Incorrect
The weight capacity is the limit on the total weight the knapsack can carry.
Which approach is commonly used to solve the 0 1 Knapsack Problem efficiently?
✗ Incorrect
Dynamic Programming efficiently solves the problem by storing intermediate results.
In the DP table, what does the entry dp[i][j] represent?
✗ Incorrect
dp[i][j] stores the best value achievable with first i items and weight limit j.
If an item's weight is more than the current weight limit j, what happens in the DP solution?
✗ Incorrect
If the item is too heavy, it cannot be included, so the value remains as without it.
What is the key difference between 0 1 Knapsack and Fractional Knapsack?
✗ Incorrect
0 1 Knapsack requires whole items; Fractional Knapsack allows fractions of items.
Explain how dynamic programming solves the 0 1 Knapsack Problem step-by-step.
Think about building solutions from smaller subproblems.
You got /4 concepts.
Describe the difference between the 0 1 Knapsack Problem and the Fractional Knapsack Problem.
Focus on item selection rules and solution methods.
You got /4 concepts.