subject

The janitor of a high school is extremely efficient. By the end of each day, all of the school's waste is in plastic bags weighing between 1.01 pounds and 3.00 pounds. All plastic bags are then taken to the trash bins outside. One trip is described as selecting a number of bags which together do not weigh more than 3.00 pounds, dumping them in the outside trash can and returning to the school. Given the number of plastic bags n, and the weights of each bag, determine the minimum number of trips the janitor has to make. For example, given n = 6 plastic bags weighing weight = [1.01, 1.99, 2.5, 1.5, 1.01], the janitor can carry all of the trash out in 3 trips: [1.01 + 1.99 , 2.5, 1.5 + 1.01]. Write a java program to implement efficient janitor and explain the time complexity of your code.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 08:10
Alook-up table used to convert pixel values to output values on a monitor. essentially, all pixels with a value of 190 or above are shown as white (i.e. 255), and all values with a value of 63 or less are shown as black (i.e. 0). in between the pixels are scaled so that a pixel with a value p is converted to a pixel of value 2/127 โˆ’+3969). if a pixel has a value of 170 originally, what value will be used to display the pixel on the monitor? if a value of 110 is used to display the pixel on the monitor, what was the original value of the pixel?
Answers: 1
question
Computers and Technology, 22.06.2019 11:00
When working with a team you should always do the following, except? question 3 options: be dependable and trustworthy be sensitive to others feelings do your fair share critique members of the group
Answers: 2
question
Computers and Technology, 22.06.2019 18:00
Which of the following physical laws can make the flow of water seem more realistic? a. motion b. gravity c. fluid dynamics d. thermodynamics
Answers: 2
question
Computers and Technology, 23.06.2019 04:00
Another name for addicting games.com
Answers: 1
You know the right answer?
The janitor of a high school is extremely efficient. By the end of each day, all of the school's was...
Questions
question
Mathematics, 28.01.2020 05:31
question
Mathematics, 28.01.2020 05:31
question
English, 28.01.2020 05:31
Questions on the website: 13722361