Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Question 1 (Task Scheduling (30 points)) Suppose that we have n tasks to schedule on a computer with a single-core processor where task i takes
Question 1 (Task Scheduling (30 points)) Suppose that we have n tasks to schedule on a computer with a single-core processor where task i takes t; time units to finish. We would like to run all of the n tasks while minimizing the total waiting time for all tasks. Assuming that the first task starts at t=0, the waiting time w for task i is the total time before it is started. For example, if we have three tasks with erecution times t = 5, t2 = 3, and t3 = 2 scheduled to run in the order (C1,C2,C3), the waiting times are wi = 0, W2 = 5, and W3 = 5+3= 8. If they are scheduled in the order (C3, C2,1), the waiting times become uz = 0, W2 = 2, and w1 = 2+3=5. (10 points) Propose a greedy algorithm that finds the optimal scheduling for the n tasks with the minimum waiting time. (5 points) Establish the running time of your algorithm. . (15 points) Prove the optimality of your algorithm
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