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 ?
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.
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development