completion time added
This commit is contained in:
parent
bb8c9edb9f
commit
824a7ef5fd
@ -2,7 +2,7 @@
|
||||
using namespace std;
|
||||
|
||||
struct sjf{
|
||||
int burst, arrival, id;
|
||||
int burst, arrival, id, completion;
|
||||
bool active;
|
||||
};
|
||||
sjf meh[30];
|
||||
@ -48,6 +48,7 @@ public:
|
||||
meh[iddd].burst--;
|
||||
k++;
|
||||
if(meh[iddd].burst == 0){
|
||||
meh[iddd].completion = k;
|
||||
completed++;
|
||||
}
|
||||
} else{
|
||||
@ -55,11 +56,20 @@ public:
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void completion()
|
||||
{
|
||||
cout<<"\n\n | Completion time\n";
|
||||
for(int j = 0; j < n; j++) {
|
||||
cout<<"P"<<j<<"| "<<meh[j].completion<<"\n";
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
int main(){
|
||||
lesgo obj;
|
||||
obj.sjfIn();
|
||||
obj.sjfProcess();
|
||||
obj.completion();
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user