Answered step by step
Verified Expert Solution
Question
1 Approved Answer
2. (20pts) Consider the following variation of Activity Selection problem Input: A set of n task a,, a2,.... an each expressed as a,-(n, di) where
2. (20pts) Consider the following variation of Activity Selection problem Input: A set of n task a,, a2,.... an each expressed as a,-(n, di) where is the release time, and d, the time duration. taking All the tasks are executed by a single CPU without a time overlap after the time duration time di Output: Minimum finish time of the last executed task. The difference from the original problem is a(release time, duration) changed from (start time, finish time): Each task ais released at the time , after which the CPU can execute it anytime taking duration dj. So the CPU can finish all the tasks anyway. Now you don't maximize the number of executed tasks, but find a schedule with the earliest time to finish all Design a greedy algorithm running in O(n2) time to compute the problem. Write all of: o o o o your basic method in 3-10 lines, complete pseudo code, proof of the algorithm correctness, and that of the running time. Make your answers succinct but include everything necessary to reason the above. Hint: You can compute f = n+ d for every a, and use it as a part of the greedy criterion, but not all
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