shortest job first scheduling non-preemptive| Code

1
2
#include<stdio.h>
int main()
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

2 Responses

This code was Excellent because of this I understand how SJF in a non-primitive way works.
how can the waiting time be negative
Enter the Number of processes : 4

Enter The Arrival Time Of Process 1 : 5
Enter The Burst Time Of Process1 : 10

Enter The Arrival Time Of Process 2 : 3
Enter The Burst Time Of Process2 : 6

Enter The Arrival Time Of Process 3 : 6
Enter The Burst Time Of Process3 : 12

Enter The Arrival Time Of Process 4 : 0
Enter The Burst Time Of Process4 : 0

Process Name Burst Time Arrival Time Waiting Time Turn Around Time
p4 0 0 0 0
p2 6 3 -3 3
p1 10 5 1 11
p3 12 6 10 22

AVERAGE WAITING TIME : 2.00
AVERAGE TURN AROUND TIME : 9.00

GANTT CHART

P4P2 P1 P3
00---3-----------11----------------------22

--------------------------------

Write a comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.