GATE Computer ScienceModerateGATE CSE
In a 0/1 knapsack of capacity 11, the items have (weight, value) = (3,3), (4,4), (5,4), (9,10), (4,4). What is the maximum total value?
- A. 10
- B. 12
- C. 13
- D. 11
Correct answer: D. 11
The standard DP table gives an optimum of 11 for capacity 11.
More Algorithms questions
- What is the length of a longest common subsequence of PROGRAMMING and ALGORITHM?
- A weighted undirected graph on vertices 0–5 has edges (0,1,4), (0,2,3), (1,2,1), (1,3,2), (2,3,4), (3,4,2), (4,5,6), (3,5,7), (2,5,8)…
- A DAG on vertices 0–5 has edges 0→2, 1→2, 2→3, 2→4, 3→5 and 4→5. How many distinct topological orderings does it have?
- With unit cost for insertion, deletion and substitution, what is the edit distance between INTENTION and EXECUTION?
- Six matrices have dimensions 30×35, 35×15, 15×5, 5×10, 10×20 and 20×25 in a chain. What is the minimum number of scalar multiplications to…
- Quicksort uses the last element of each sub-array as pivot and compares every other element of the sub-array with it once. On [4, 7, 1, 9…