SJF

SHORTEST JOB FIRST

Definition

Question: What is SJF CPU Sechduling Algorithm?

Answer: In Shortest job first(SJF) algorithm,It is a type of CPU scheduling. This algorithm associate with each process the length of the latter’s next CPU burst. When the CPU is available, it is assigned to the process that has the smallest next CPU burst time. It is a scheduling policy that selects for executing the waiting process with the smallest execution time. If two processes have the same length next CPU burst, First Come will be executed.

Example: we have three processes P1, P2, P3 their burst time are 3, 4, 7, 8

SOLVE SJF

Enter the number of process:-

Enter the value of burst time in below table:-

Process Burst time Waiting time Turn around time

Average waiting time is:-

Average turnaround time is:-

-->