== Suppose that we have n tasks to schedule on a computer with a single- core...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
== 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 tasks 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 execution times t = 5, t2 = 3, and t3 = 2 scheduled to run in the order (C1, C2, C3), the waiting times are w = 0, w = 5, W2 and w3 5+3=8. If they are scheduled in the order (C3, C2, C1), the waiting times become ws =0, w = 2, and w = 2+3 = 5. Propose a greedy algorithm that finds the optimal scheduling for the n tasks with the minimum waiting time. Prove the optimality of the algorithm and establish its running time. == 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 tasks 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 execution times t = 5, t2 = 3, and t3 = 2 scheduled to run in the order (C1, C2, C3), the waiting times are w = 0, w = 5, W2 and w3 5+3=8. If they are scheduled in the order (C3, C2, C1), the waiting times become ws =0, w = 2, and w = 2+3 = 5. Propose a greedy algorithm that finds the optimal scheduling for the n tasks with the minimum waiting time. Prove the optimality of the algorithm and establish its running time.
Expert Answer:
Answer rating: 100% (QA)
To schedule the tasks with minimum waiting time we can use the following greedy algorithm 1 Sort the ... View the full answer
Related Book For
Operating Systems Internals and Design Principles
ISBN: 978-0133805918
8th edition
Authors: William Stallings
Posted Date:
Students also viewed these programming questions
-
"internet radios" for streaming audio, and personal video recorders and players. Describe design and evaluation processes that could be used by a start-up company to improve the usability of such...
-
CANMNMM January of this year. (a) Each item will be held in a record. Describe all the data structures that must refer to these records to implement the required functionality. Describe all the...
-
Manual programming for the following picture : 3.000 2.250 1.500 .750 PART#:00002 ZEE & SLOTS (MANUAL PROGRAMMING) 5.0 REF. .500 5 1.375 3.000 2.250 TITLE: PART#: 00002 (ZEE & SLOTS) DRAWN BY:...
-
Refer to the information for Raman Limited in E18-9. Following the year ended December 31, 2014, Raman continued to actively trade its securities investments until the end of its 2015 fiscal year,...
-
The bottom of a large theater screen is 3 ft above your eye level and the top of the screen is 10 ft above your eye level. Assume you walk away from the screen (perpendicular to the screen) at a rate...
-
Meghann Patrick is a former employee of Altria Group Distribution Company. After her employment was terminated, Patrick sued Altria and a supervisor at Altria, alleging employment-related claims...
-
On January 1, 2015, Johnsonville Enterprises acquired 80 percent of Stayer Companys outstanding common shares in exchange for $3,000,000 cash. The price paid for the 80 percent ownership interest was...
-
K 1 A waffle recipe that serves 7 calls for 1 cups of flour. How many cups of flour will be needed if the chef must serve 28 people? 10- The chef needs cups of flour. (Type an integer or a simplified...
-
What are the structural and biochemical features of prokaryotic cell membranes and cell walls, and how do these components contribute to cellular integrity, homeostasis, and environmental...
-
Under what circumstances may an S corporation switch to a tax year ending on December 31?
-
Differentiate the treatment of fringe benefits of a corporation, partnership, and S corporation.
-
What is the special treatment of S corporation expenses owed to shareholders? How does this treatment differ from that of a C corporation?
-
Describe some of the key factors that guide service and retail location decisions.
-
What is the only credit available as a reduction in the tax on built-in gain and the tax on excess net passive income for an S corporation?
-
Oxford Cereals recently conducted a public experiment in which it claims it has successfully debunked the statements of groups such as the TriCities Consumer Concerned About Cereal Companies That...
-
Maria Castigliani is head of the purchasing department of Ambrosiana Merceti, a medium-sized construction company. One morning she walked into the office and said, The main problem in this office is...
-
A process references five pages, A, B, C, D, and E, in the following order: Assume that the replacement algorithm is first-in-first-out and find the number of page transfers during this sequence of...
-
OS/2 is an obsolete OS for PCs from IBM. In OS/2, what is commonly embodied in the concept of process in other operating systems is split into three separate types of entities: session, processes,...
-
Consider the following code using the POSIX Pthreads API: thread2.c #include #include #include #include int myglobal; void *thread_function(void *arg) { int i,j; for ( i=0; i <20; i++ ) { j=myglobal;...
-
Baggai Enterprises has an ROA of 10 percent, retains 30 percent of earnings, and has an equity multiplier of 1.25. Mondale Enterprises also has an ROA of 10 percent, but it retains two-thirds of...
-
International Business Machines (NYSE: IBM), which currently pays a dividend of \($3.40\) per share, has been the subject of two other examples in this reading. In one example, an analyst estimated...
-
An analyst is preparing a forecast of dividends for Hoshino Distributors for the next five years. He uses a spreadsheet model with the following assumptions: Sales are $100 million in Year 1. They...
Study smarter with the SolutionInn App