Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Problem 4: You are scheduling a set of jobs on a CPU. Only one job can run on the CPU at a time. Each job
Problem 4: You are scheduling a set of jobs on a CPU. Only one job can run on the CPU at a time. Each job ji requires some amount of time t and has a deadline di, which is the time that the job must be finished by (assume that the current time is 0). Your goal is to schedule jobs on the CPU so that every job finishes by its deadline. For example, there may be 3 jobs j,j2,/3 that have deadlines of 10, 2, and 3, and take 5,1, and 2 seconds each to run. In the above example, you could schedule job j2 at time 0, so it finishes at time 1. Job /3 could then start at time 1, and finish at time 3. Then job / could start at time 3 and finish at time 8. In this way, all jobs finish by their deadlines. There are other solutions as well Design a greedy algorithm to determine what ime each job should start. l'he output of your algorithm should be an arrays1, s2, snj, where si represents the starting time for job ji. If it is not possible for every job to finish before its deadline, then your algorithm should output this
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started