subject
Computers and Technology, 02.04.2021 20:30 mluz

Recall the job scheduling problem from the lectures: we have a collection of n processing jobs and the length of job i, i. e., the time to process job i, is given by L[i]. This time, you are given a number M and you are told that you should finish all your processing jobs between time 0 and M; any job not fully processed in this window then should be paid a penalty that is the same across all the jobs. The goal is to find a schedule of the jobs that minimizes the penalty you have to pay, i. e., it minimizes the number of jobs not fully processed in the given window. Design a greedy algorithm that given the array L[1 : n] of job lengths and integer M, finds the scheduling that minimizes the penalty in O(n log n) time. (25 points)
Example: Suppose the length of the jobs are 17,3,9, 2, 4] and M = 7. Then, one optimal solution is to run the jobs [3, 4] in the window (0 : 7] and then pay a penalty of 3 for the remaining jobs. Note that we could have alternatively picked the jobs [3, 2] or [2, 4] also but still had to pay a penalty of 3.
Simple bonus credit: Can you design an algorithm that instead runs in O(n + M) time? (+5 points)

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 22:00
Formula that contains a nested function that first calculates the average of the values in range e6: p6 and uses the round function to round that average to the nearest 10 dollars. use -1 for the value of the number digit argument. would the formula be =round(average(e6: p6),0
Answers: 1
question
Computers and Technology, 22.06.2019 21:00
Describir textbook icon_person mira los dibujos y describe lo que estΓ‘ pasando. usa los verbos de la lista.
Answers: 1
question
Computers and Technology, 23.06.2019 01:20
Write a function balancechemical to balance chemical reactions by solving a linear set of equations. the inputs arguments are: reagents: symbols of reagents in string row array products: symbols of products in string row array elements: elements in the reaction in string row array elcmpreag: elemental composition of reactants in two dimensional numeric array elcmpprdcts: elemental composition of prducts in two dimensional numeric array hint: the first part of the problem is setting up the set of linear equations that should be solve. the second part of the problem is to find the integers from the solution. one way to do this is to mulitiply the rational basis for the nullspace by increasing larger integers until both the left-and right-side integers exist. for example, for the reaction that involves reacting with to produce and : reagents=["ch4", "o2"]; products =["co2", "h2o"]; elements =["c","h", "o"] elcmpreag=[1,4,0;
Answers: 3
question
Computers and Technology, 24.06.2019 13:10
Write a program that has a conversation with the user. the program must ask for both strings and numbers as input. the program must ask for at least 4 different inputs from the user. the program must reuse at least 3 inputs in what it displays on the screen. the program must perform some form of arithmetic operation on the numbers the user inputs. turn in your .py file as well as a screenshot of your program's output. include comments in your code to explain how it works an example program run might look like (have fun with this and be creative): β€˜what is your name? ’ β€œjosh” β€˜, josh. what is your favorite color? ’ β€œgreen” β€˜mine too. do you also like ice cream? ’ β€œno” β€˜josh, how old are you? ’ β€œ40” β€˜ and how many siblings do you have? ’’ β€œ3” β€˜that means you are one of 4 kid(s). is green the favorite color of anyone else in your house? ’
Answers: 3
You know the right answer?
Recall the job scheduling problem from the lectures: we have a collection of n processing jobs and t...
Questions
question
Biology, 12.03.2020 22:54
Questions on the website: 13722363