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, 22.06.2019 06:30
Exchanging which type of data uses the least bandwidth? music photographs video voice bandwidth- the amount of data that can be moved between two points in a set time period
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 20:00
The blank button automatically displays next to the data when you select a range of numeric data which is an available option for creating a chart
Answers: 3
question
Computers and Technology, 22.06.2019 20:50
What is the difference between windows 7 and windows 10?
Answers: 1
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
Mathematics, 21.11.2020 01:00
question
History, 21.11.2020 01:00
question
Mathematics, 21.11.2020 01:00
question
Mathematics, 21.11.2020 01:00