Machine-translated by Google. Questions are authored in English.
Top

Discussion

Suppose there are 5 processes P1, P2, P3, P4 and P5 with processing time requirements 10, 6, 2, 4 and 8 respectively. What is the average completion time if SJF (Shortest Job First) policy is used ?

  • A.10
  • B.12
  • C.14
  • D.16

Answer: C

The average completion time is 14.

SJF runs the jobs in increasing order of time: 2, 4, 6, 8, 10 (P3, P4, P2, P5, P1). Each job completes when all the jobs before it and itself have run.

\[ \begin{aligned} \text{completions} &= 2, 6, 12, 20, 30 \\ \text{average} &= \frac{70}{5} = 14 \end{aligned} \]

The average waiting time is \((0+2+6+12+20)/5 = 8\), which is not offered; 10 is simply the longest job, and 12 and 16 match neither measure. The question asks for completion (turnaround) time with all jobs arriving at 0.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.