Question: 1 . A 0 - 1 Knapsack problem is below: 4 items Max weight is 5 Item 1 : weight 2 ; benefit 3 Item

1. A 0-1 Knapsack problem is below:
4 items
Max weight is 5
Item 1: weight 2; benefit 3
Item 2: weight 4 ; benefit 5
Item 3: weight 5 ; benefit 6
Item 4: weight 3 ; benefit 4
(1)(10 points) What is the subproblem of the shaded cell?
(2)(35 points) Please solve this 0-1 Knapsack problem using the given table.
(3)(15 points) Please show what items should be placed in the knapsack to maximize the benefit.
2. The longest nondecreasing subsequence of a sequence is the longest subsequence in which all the elements are nondecreasing. This subsequence is not necessarily contiguous, or unique.
For example: 'lamar' has 3 longest nondecreasing subsequences, 'lmr', 'amr', and 'aar'.
The longest common subsequence can be used to find the longest nondecreasing subsequence of a sequence.
(1) The first sequence is the given original sequence,
(2) The second sequence is a sorted sequence by ordering all elements in the first sequence in nondecreasing/alphabetical order.
(3) Apply LCS to the first and second sequences to find the longest nondecreasing subsequence of the given original sequence (i.e., the first sequence).
Please find the longest nondecreasing subsequence of 'algorithm' using the steps above. (40 points)
1 . A 0 - 1 Knapsack problem is below: 4 items

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!