Escolar Documentos
Profissional Documentos
Cultura Documentos
Questão 1
Códigos:
EQUIDADE:
#include <stdio.h>
#include <stdlib.h>
#define NUMBER_OF_FRAMES 64
#define NUMBER_OF_PROCESSES 4
int frames[NUMBER_OF_FRAMES];
int main() {
int i, j, time, process_number, page_number, frame_number;
}
}
return 0;
}
SAÍDAS:
PROPORCIONAL AO TAMANHO:
#include <stdio.h>
#include <stdlib.h>
#define NUM_FRAMES 64
#define NUM_PROCESSES 4
int main() {
int process_sizes[NUM_PROCESSES] = {16, 128, 64, 48}; // tamanhos
dos processos
int num_frames_allocated[NUM_PROCESSES] = {0}; // número de frames
alocados para cada processo
int frames[NUM_FRAMES] = {0}; // indicação de quais frames estão
alocados
{1, 3, 50}, {2, 3, 51}, {3, 2, 17}, {4, 2, 18}, {5, 1, 6},
{6, 4, 15}, {7, 4, 16}, {8, 2, 1}, {9, 4, 17}, {10, 3, 2},
{11, 3, 3}, {12, 1, 7}, {13, 2, 2}, {14, 4, 18}, {15, 2, 31},
{16, 2, 32}, {17, 2, 33}, {18, 4, 2}, {19, 4, 3}, {20, 3, 16},
{21, 3, 17}, {22, 1, 15}, {23, 1, 16}, {24, 4, 19}, {25, 2, 20}
};
break;
}
}
}
return 0;
}
SAÍDAS: