3
1

Fixed worst fit and added missing labels for best and worst fit.

This commit is contained in:
K 2024-11-05 00:28:33 +05:30
parent f598faff49
commit 3e21e023a1
Signed by: notkshitij
GPG Key ID: C5B8BC7530F8F43F

View File

@ -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))) {