Question: 1. Graded Problem (Page limit: 1 sheet; 2 sides) A bandit has broken into a store and has found many items he wants to bring

 1. Graded Problem (Page limit: 1 sheet; 2 sides) A bandit

1. Graded Problem (Page limit: 1 sheet; 2 sides) A bandit has broken into a store and has found many items he wants to bring with him and then flee the scene. There are n items, of positive integer sizes s1, s2:sn. Each item has a positive value to him, ,U2,.. ., Vn. Being greedy the bandit would have liked to bring everything, but for the fact that his getaway car has only a limited capacity that can hold a total size at most S. Therefore his problem is to select a subset4G { 1,2, . . . ,n) such that the sum ,EAM S and the total value his total loot) iEA an al in pa n ning algorithm to solve this problem. Your elem should hav. worst ca-e running time polynomial in s, s2 Analyze its running time. Prove your algorithm is correct, and runs in your stated time. Hint: Suppose his total capacity is S-1 ,... , Sn, v1, v2,... , vn, and S

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 Databases Questions!