Round Robin
Round Robin
ARRIVAL TIME:
#include<iostream>
using namespace std;
int rem_bt[n];
for (int i = 0 ; i < n ; i++)
rem_bt[i] = bt[i];
while (1)
{
bool done = true;
if (rem_bt[i] > 0)
{
done = false; // There is a pending process
#include<iostream>
using namespace std;
void findWaitingTime(int processes[], int n,
int bt[], int wt[], int quantum)
{
int rem_bt[n];
for (int i = 0 ; i < n ; i++)
rem_bt[i] = bt[i];
.
while (1)
{
bool done = true;
rem_bt[i] -= quantum;
}
else
{
t = t + rem_bt[i];
wt[i] = t - bt[i];
rem_bt[i] = 0;
}
}
}