GATE | GATE-CS-2005 | Question 87
We are given 9 tasks T1, T2…. T9. The execution of each task requires one unit of time. We can execute one task at a time. Each task Ti has a profit Pi and a deadline di Profit Pi is earned if the task is completed before the end of the dith unit of time.
Task T1 T2 T3 T4 T5 T6 T7 T8 T9
Profit 15 20 30 18 18 10 23 16 25
Deadline 7 2 5 3 4 5 2 7 3
Are all tasks completed in the schedule that gives maximum profit?
(A) All tasks are completed
(B) T1 and T6 are left out
(C) T1 and T8 are left out
(D) T4 and T6 are left out
Answer: (D)
Explanation:
Task T1 T2 T3 T4 T5 T6 T7 T8 T9
Profit 15 20 30 18 18 10 23 16 25
Deadline 7 2 5 3 4 5 2 7 3
To maximize profit, we can finish tasks in following order T7, T2, T9, T5, T3, T8, T1
Quiz of this Question
Last Updated :
28 Jun, 2021
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...