INPUT NUMERICAL
Consider following set of processes for executing practical No:04, 05 and 06
Process Arrival-Time Burst Time Priority
P1 0 8 2
P2 0 3 1
P3 0 1 3
Calculate average waiting time and average turnaround time for all these process using SJF and Priority
Scheduling algorithm?
/////////////////////////////////////////////////////////////////////////////////////////////
EXPECTED OUTPUT(SJF)
Enter the number of process:3
Enter process name, arrival time & execution time:p1 0 8
Enter process name, arrival time & execution time:p2 0 3
Enter process name, arrival time & execution time:p3 0 1
Pname arrivaltime executiontime waitingtime tatime
p3 0 1 0 1
p2 0 3 1 4
p1 0 8 4 12
Average waiting time is:1.666667
Average turnaroundtime is:5.666667
/////////////////////////////////////////////////////////////////////////////////////////////
EXPECTED OUTPUT(Priority)
Enter the number of process: 3
Enter process name,arrivaltime,execution time & priority:p1 0 8 2
Enter process name,arrivaltime,execution time & priority:p2 0 3 1
Enter process name,arrivaltime,execution time & priority:p3 0 1 3
Pname arrivaltime executiontime priority waitingtime tatime
p3 0 1 3 0 1
p1 0 8 2 1 9
p2 0 3 1 9 12
Average waiting time is:3.333333
Average turnaroundtime is:7.333333