Answer:
Explanation:
we'll begin by giving some introduction on the greedy choice property.
Greedy choice property :
As we have to minimize the maximum delay i.e finish time - deadline. To begin, we have to complete the job first which has the smallest deadline, then the next smallest and so on. If two jobs have same deadline, we then choose the job which has lesser time.
From the example given, the deadline for jobs are thus:
job1 => 11,
job2 => 6,
job3 =>12,
job4 =>20
sorting them according to the deadline gives;
job 2 => 6, job 1 => 11, job 3 =>12, job 4 =>20
therefore 2 1 3 4 is the optimal solution.
proof:
According as the greedy choice property, it says local optimal leads to the global minimum. From the question given, we are choosing a job with less deadline. Say the deadline is greater than the finish time we are skipping the jobs. Finally this helps us to minimize the maximum delay.