Professional Documents
Culture Documents
Worst Fit Allocation
Worst Fit Allocation
h>
if (best_idx==-1)
continue;
//At the end allot the block to process and re-calculate free-space
blockSize[best_idx]=processSize[i];
allocation[i]=best_idx;
}
int main()
{
int blockSize[] = {100, 500, 200, 300, 600};
int processSize[] = {212, 417, 112, 426};
int m = sizeof(blockSize)/sizeof(blockSize[0]);
int n = sizeof(processSize)/sizeof(processSize[0]);
return 0 ;
}