1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
True [87]
3 years ago
14

The 0-1 knapsack problem is the following. A thief robbing a store finds n items. The ith item is worth vi dollars and weighs wi

pounds, where vi and wi are integers. The thief wants to take as valuable a load as possible, but he can carry at most W pounds in his knapsack, for some integer W . Which items should he take?
Computers and Technology
1 answer:
icang [17]3 years ago
3 0

Step by step Explanation:

Based on what we could deduce from the above statement, the items he should take are:

  • must either take one single item or must leave the other behind,
  • and only a whole amount of an item must be taken,
  • in which an item cannot be taken more than once into his knapsack.

Hence, the thief needs to carefully determine items with an optimal value which still falls within his specified weight (W).

You might be interested in
Write a program whose input is a string which contains a character and a phrase, and whose output indicates the number of times
otez555 [7]

Answer:

The program written in python is as follows

def countchr(phrase, char):

     count = 0

     for i in range(len(phrase)):

           if phrase[i] == char:

                 count = count + 1

     return count

phrase = input("Enter a Phrase: ")

char = input("Enter a character: ")

print("Occurence: ",countchr(phrase,char))

Explanation:

To answer this question, I made use of function

This line defines function countchr

def countchr(phrase, char):

This line initializes count to 0

     count = 0

This line iterates through each character of input phrase

     for i in range(len(phrase)):

This line checks if current character equals input character

           if phrase[i] == char:

The count variable is incremented, if the above condition is true

                 count = count + 1

The total number of occurrence is returned using this line

     return count

The main method starts here; This line prompts user for phrase

phrase = input("Enter a Phrase: ")

This line prompts user for a character

char = input("Enter a character: ")

This line prints the number of occurrence of the input charcater in the input phrase

print("Occurence: ",countchr(phrase,char))

4 0
3 years ago
Thanks for help evreybody
ladessa [460]

Answer:

np

Explanation:

7 0
3 years ago
Read 2 more answers
Mike has never used a slide software before, but he needs to create a presentation by the end of the week. what recourse would b
ankoles [38]

This is an incomplete question. The complete question is given below:

Mike has never used slide presentation software before but he needs to create a presentation by the end of the week what resource would be most helpful to mike

a. The 350-page printed manual from the slide presentation software publisher

b. A free tutorial the slide presentation software publisher has posted on the company website

c. A trouble-shooting website created by a third party

d. The 350-page online manual from the slide presentation software publisher

Answer:

b - A free tutorial the slide presentation software publisher has posted on the company website

Explanation:

As Mike has a short time and no prior experience with a slide software, then in this scenario, the best, simplest and fastest way to learn and create a presentation a free tutorial which the slide presentation software publisher has posted on the company website  as this is the same company that has created this particular software so he can be rest-assured that the resource he is relying on is authentic and up-to-date with information on latest features.

Moreover, it's efficient and quick way to learn from a free tutorial rather than from 350-page printed or online manual especially for a beginner.

Besides, his purpose is to create the presentation using the software and not trouble-shooting so trouble-shooting website created by a third party is not useful for him and it also might not be authentic or updated as well.

6 0
2 years ago
What is a quasi vpn?
Natasha2012 [34]

Answer:

i don't think there is such thing as a quasi vpn

Explanation:

6 0
3 years ago
What is an example of Big Data?
Y_Kistochka [10]

Answer:

providing real-time data feeds on millions of people with wearable devices

Explanation:

6 0
3 years ago
Other questions:
  • Minimalism is a major movement in postmodern art. O True O False
    14·1 answer
  • Which statement best explains taxation without representation was a major issue for colonists?
    12·1 answer
  • What were the goals of the “paperless society” ideal?
    14·2 answers
  • Data as a service began with the notion that data quality could happen in a centralized place, cleansing and enriching data and
    15·1 answer
  • How to make changes to a file on the USB drive
    6·2 answers
  • What will be the output of the following code? <?php $foo = 'Bob'; $bar = $foo; $bar = "My name is $bar"; print $bar; print $
    8·2 answers
  • I have a question about a hotel tv: So I’ve brought my Nintendo Switch and my dock and plugged it in to the tv. Everything seems
    13·1 answer
  • Choose and explain, step by step, one method of backing up student files either manually or using a cloud service.
    10·1 answer
  • Keyshia wants to add movement to her PowerPoint presentation. Which tab should she use to complete this task
    15·2 answers
  • In what ways is the human brain like a computer? In what ways is it different?
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!