Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Suppose you are given a set S = {a1,a2,.,an} of tasks, where task a; requires pi units of processing time to complete, once it


Suppose you are given a set S a,a2,...,an) of tasks, where task a, requires p units of processing time to complete, once it h 

Suppose you are given a set S = {a1,a2,.,an} of tasks, where task a; requires pi units of processing time to complete, once it has started. You have one computer on which to run these tasks, and the computer can run only one task at a time. Let c; be the completion time of task a;, that is, the time at which task a; completes processing. Your goal is to minimize the average completion time, that is, to minimize E1 Ci. For example, suppose there are two tasks, aj and az, with pi = 3 and p2 = 5, and consider the schedule in which az runs first, followed by a1. Then c2 = 5, cl = 8, and the average completion time is (5+8)/236.5. If task aj runs first, however, then c1 = 3, c2 = 8, and the average completion time is (3+8)/2 = 5.5. (1) Design an algorithm that schedules the tasks in S so as to minimize the average completion time. Write down the pseudocode of your algorithm, which should return the minimum average completion time at the end. (2) Compute the time complexity of your algorithm. (3) Prove that your algorithm indeed minimizes the average completion time.

Step by Step Solution

3.31 Rating (151 Votes )

There are 3 Steps involved in it

Step: 1

1 Algorithm is very simple Just we have to observe the thing that scheduling that with less completion time before scheduling task having greater comp... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database management systems

Authors: Raghu Ramakrishan, Johannes Gehrke, Scott Selikoff

3rd edition

72465638, 978-0072465631

More Books

Students also viewed these Accounting questions