Fixed worst fit and added missing labels for best and worst fit.
This commit is contained in:
parent
f598faff49
commit
3e21e023a1
@ -45,6 +45,7 @@ void NextFit() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void BestFit() {
|
void BestFit() {
|
||||||
|
cout<<endl<<"BEST FIT:";
|
||||||
for (int i=0; i<prSize; i++) {
|
for (int i=0; i<prSize; i++) {
|
||||||
bool check = false;
|
bool check = false;
|
||||||
int k, store = 999;
|
int k, store = 999;
|
||||||
@ -66,8 +67,9 @@ void BestFit() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void WorstFit() {
|
void WorstFit() {
|
||||||
bool check = false;
|
cout<<endl<<"WORST FIT:";
|
||||||
for (int i=0; i<prSize; i++) {
|
for (int i=0; i<prSize; i++) {
|
||||||
|
bool check = false;
|
||||||
int k, store = -1;
|
int k, store = -1;
|
||||||
for (int j=0; j<blkSize; j++) {
|
for (int j=0; j<blkSize; j++) {
|
||||||
if ((blocks[j] - processes[i] >= 0 && (blocks[j] - processes[i] > store))) {
|
if ((blocks[j] - processes[i] >= 0 && (blocks[j] - processes[i] > store))) {
|
||||||
|
Loading…
Reference in New Issue
Block a user