Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)
Paste
Pasted as C by registered user 13bce0243 ( 9 years ago )
#include<stdio>
#include<conio>
void accept(int a[],int n)
{
int i;
for(i=0;i<n for(i=0;i for(i=0;i for(j=0;j>a[j+1])
{
temp=a[j];
a[j]=a[j+1];
a[j+1]=temp;
}
}
void first_fit(int psize[],int np,int msize[],int nm)
{
nt i,j,itot,etot,flag[30]={0};
tot=etot=0;
for(i=0;i<np for(j=0;j xss=removed>=psize[i])
{
flag[j]=1;
itot=itot+msize[j]-psize[i];
break;
}
}
if(j==nm)
printf("\n\nTHERE IS NO SPACE FOR PROCESS %d ",i);
}
for(i=0;i<nm;i++)
{
if(flag[i]==0)
etot=etot+msize[i];
}
printf("\n\nPROCESSES::");
display(psize,np);
printf("\n\nMEMORY HOLES::");
display(msize,nm);
printf("\n\nTOTAL SUM OF INTERNAL FRAGMENTATION = %d ",itot);
printf("\n\nTOTAL SUM OF EXTERNAL FRAGMENTATION = %d ",etot);
}
Revise this Paste