subject

Athief is given the choice ofnobjects to steal, but only has one knapsack with a capacity of takingmweight. each objectihas weightwi, and profitpi.(a) first, suppose that the objects are divisible (e. g., the thief is in a cheese shop and the itemsare rolls of cheese that can be cut). for each objecti, if a fractionxi, 0≤xi≤1 (takingxi= 1 would be taking the entire object) is placed in the knapsack, then the profit earnedispixi. come up with an efficient greedy algorithm for maximizing the profit of the thief. prove the correctness and running time.(b) now, suppose the items cannot be taken fractionally. in other words, the thief can eithertake an entire item or leave it behind. suppose we also know the following: the order of theseitems when sorted by increasing weight is the same as their order when sorted by decreasingvalue. give a greedy algorithm to find an optimal solution to this variant of the knapsackproblem. prove the correctness and running time.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 17:00
Annie is creating a corporate report for a company’s annual meeting. in the report, she wants to add the signature of various department heads. which device can annie use to capture signatures to include in the report? a. printer b. monitor c. e-reader d. digitizing tablet
Answers: 1
question
Computers and Technology, 23.06.2019 15:30
The song about casey jones a railroad engineer who gives his life on the job would most likely gall under the folk song category of? a-work song b-nonsense song c-religious song d-ballad
Answers: 1
question
Computers and Technology, 24.06.2019 04:30
Write and test a python program to find and print the largest number in a set of real (floating point) numbers. the program should first read a single positive integer number from the user, which will be how many numbers to read and search through. after reading in all of the numbers, the largest of the numbers input (not considering the count input) should be printed.
Answers: 1
question
Computers and Technology, 24.06.2019 15:40
In the above figure, what type of cylinder arrangement is shown in the figure above? a. l-type b. v-type c. in-line d. horizontal pls make sure its right if its rong im grounded for 3months
Answers: 1
You know the right answer?
Athief is given the choice ofnobjects to steal, but only has one knapsack with a capacity of takingm...
Questions
question
Mathematics, 23.04.2021 02:50
question
Mathematics, 23.04.2021 02:50