roundrobin_less_queue
roundrobin_less_queue
h>
void insert(int p) {
queue[++rear] = p;
}
int delete() {
return queue[front++];
}
int main() {
int n, tq, time = 0;
float totalWT = 0, totalTAT = 0, totalRT = 0;
int execTime = (bt[p] > tq) ? tq : bt[p]; // Execute the process for a
time quantum
time += execTime;
bt[p] -= execTime;
// Output results
printf("\nPID\tAT\tBT\tCT\tTAT\tWT\tRT\n");
for (int i = 0; i < n; i++) {
printf("P%d\t%d\t%d\t%d\t%d\t%d\t%d\n", i + 1, at[i], tempBT[i], ct[i],
tat[i], wt[i], rt[i]);
}
return 0;
}