The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 103 Weeks Ago, 4 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
Need a VERY EXPERIENCED java programmer to help with the following problem.
A Scheduling Problem
You are in charge of writing a scheduler for a widget machine. Every 10 seconds, a new job
comes in. A job has a deadline, and a size. The size is the number of seconds it will take
to complete the job. Only one job can be in process at a time. Once the widget machine
starts on a job, it must finish it. Some jobs are worth more money, a value. Every time a job
nishes, the next job should be the one with the highest value, but no job should be started
if it can't be finished in time for the deadline.
Write a priority queue to process the jobs and report which ones will finish.
Line i of the input contains the ith job that appears after i hours exactly. The job has 3
numbers: the value, the size, and the deadline (in that order). Here is a sample input:
12 35 35
65 25 50
30 30 300
40 50 70
2 3 100
Data Structures and Introduction to AlgorithmsDue: 10/2/2015 at noon (12:00pm)1 Assignment 4: Priority QueuesA Scheduling ProblemYou are in charge of writing a scheduler for a widget machine. Every 10 seconds, a new jobcomes in. A job has a deadline, and a size. The size is the number ofsecondsit will taketo complete the job. Only one job can be in process at a time. Once the widget machinestarts on a job, it must finish it. Some jobs are worth more money, a value. Every time a jobfinishes, the next job should be the one with the highest value, but no job should be startedif it can’t be finished in time for the deadline.Write a priority queue to process the jobs and report which ones will finish.Lineiof the input contains theith job that appears afterihours exactly. The job has 3numbers: the value, the size, and the deadline (in that order). Here is a sample input:12 35 3565 25 5030 30 30040 50 702 3 100This input has 5 jobs. Job 0 comes in at time 0. It has the highest value of any jobseen thus far, so it gets started. It will take 35 seconds, so it will complete at time 35. Thedeadline is 35, so it will complete on time, and thus will be made. At time 10, job 1 arrived.At time 20, job 2 arrived. At time 30, job 3 arrived. At time 35, when job 0 finishes, thehighest value job is job 1 (value 65). However, if it was started now, it would finish at time60. This is after the deadline, so job 1 cannot be completed in time. The next highest valuejob is job 3 (value 40). It also cannot be completed in by the deadline. The next highestvalue job is job 2 (value 30). It has size 30. It will finish at time 65 which is less than itsdeadline. So, this will be the next job. At time 40, job 4 arrives. When job 2 finishes attime 65, job 4 is the highest priority job. It can be completed at time 68, which is less thanthe deadline, so it will be completed. The output will be the list of completed jobs in theorder they are completed.0 2 41
Attachments:
-----------