![]() Initially it's value is 0 (i.e no processes are completed yet). for checking how many processes are completed we use coun t. In this code we are going to use a loop which executed until all the processes are completed.and we will use 9th process because we assumed that there will not be more than 10 process but you can use any number. we initialize the burst time of a process with the maximum (you can take any maximum value).(If you confused then don't worry you will be able understand after going through code) First we copy the burst time of the process in a new array temp because in the further calculation we will be going to decrease the Burst time of the process but we will have to need the real burst time of the process in the calculation of the waiting time. ![]() then after an array of the structure type. In this code first we are creating the structure for the process in which we are declaring the waiting time, Arrival time, Burst time ,Priority and turn around time. This code is for Preemptive Shortest job first algorithm
0 Comments
Leave a Reply. |