You are on page 1of 1

SHORTEST JOB FIRST SCHEDULING

Ex. No. : Date AIM: To implement Shortest Job First (SJF) CPU scheduling algorithm with same arrival time. :

ALGORITHM: 1. Start the program. 2. Get the number of process, process name, process number, burst time of each process. 3. Sort the process in the ascending order of their burst time. 4. Initialize the turn around time of first process as its burst time and waiting time as 0. 5. Calculate the turn around time and waiting time if remaining process using Turn around time = Turnaround time of previous process + Burst time. 6. Calculate total turn around time and total waiting time as Total waiting time = waiting time of all processes. Total turnaround time = turnaround time of all processes. 7. Calculate the average turn around time and waiting time as Total turnaround time Average turnaround time= ------------------------Number of process

Total waiting time Average waiting time = ------------------------Number of process

8. End the program.

You might also like