subject

Suppose you are packing for a backpacking trip and trying to decide which snacks to bring. your home pantry contains m snack items, each of which has a certain weight wi and a calorie value vi. your backpack can only hold a maximum weight of w , and for your journey you need a minimum of v calories. therefore, you need to answer the question: is there is some set s of items from your pantry such that the sum of the weights of the items in s is less than or equal to w , while the sum of the calorie values of the items in s is greater than or equal to v. required:
a. describe a (deterministic) algorithm for answering the question. is it a polynomial-time algorithm? explain your answer.
b. describe a non-deterministic algorithm for deciding the question. is it a nondeterministic polynomial-time algorithm?

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 08:00, Leggett8152
What best describes a career pathway in a lodging career? a worker starts out as an amusement attendant, then becomes a recreation worker, and then becomes a gaming worker within five years. a worker starts out as a bell hop, then becomes a night clerk, and then becomes a hotel manager within five years. a worker starting out as a tour guide, then becomes a travel clerk, and then becomes a travel agent within five years. a worker starts out as a server, then becomes a food preparer, and then becomes a head chef within five years.
Answers: 1
image
Computers and Technology, 22.06.2019 12:30, Machuco127
Some of the first computer games were created in the early 1970s by college students experimenting after hours to see what the were capable of doing.
Answers: 3
image
Computers and Technology, 22.06.2019 21:30, Cheflulu5727
Write a function named printfloatrepresentation(float number) that will print the floating point representation of a number using the format given below. (sign bit) exponent in binary (assumed bit).significandfor example if the number passed an argument is 71 yourprogram should print (0) 10000101 (1).00011100000000000000000similarl y if the number passed to the function as argument is -71 the program should print (1) 10000101 (1).00011100000000000000000
Answers: 3
image
Computers and Technology, 22.06.2019 23:30, brainbean
Select all that apply. which of the following are proofreading options included in microsoft word? spell check find replace grammar check formatting check
Answers: 1
You know the right answer?
Suppose you are packing for a backpacking trip and trying to decide which snacks to bring. your home...

Questions in other subjects:

Konu
Mathematics, 07.11.2019 01:31
Konu
Mathematics, 07.11.2019 01:31