For example, suppose that n=3, t1 = 7, t2 = 12, t3 = 4, and the processor executes the jobs in the order 2 1 3. Then the average waiting time is:
(12 + (12 + 7) + (12 + 7 + 4))/3 = 54/3 = 18.A better order would be 1 3 2 (with an average time of 13.666), but even this is not optimal.
Devise a greedy algorithm to find the optimum ordering for this scheduling problem and prove that your algorithm produces the optimum ordering. State and briefly justify the running time of your algorithm.
Back up to Spring 2001 CMSC 641 Homepage