Question: What would be the algorithm for the following C code? Can I just get pseudocode, please? int * FIFOAlgorithm( int n, int *a, int number)

What would be the algorithm for the following C code? Can I just get pseudocode, please?

int* FIFOAlgorithm(int n, int *a, int number) { int i,j,k,frame[number],available,pageFault=0; static int PageFaultcount[] = {0,0,0,0,0}; for(i=0;ifor(i=1;i<=n;i++) { if(i%2000 == 0) { PageFaultcount[((i/2000)-1)] = pageFault; // printf(" FIFO : %d = %d", i, pageFault);  } available=0; for(k=0;kif(frame[k]==a[i]) available=1; if (available==0){ frame[j]=a[i]; j=(j+1)%number; pageFault++; } } //printf(" FIFO : Total no of page faults %d",pageFault);  return PageFaultcount; } int isHit(int data, int nf, int *p) { int hit=0,j; for( j=0; jif(p[j]==data) { hit=1; break; } } return hit; } int getHitIndex(int data, int nf, int *p) { int hitindex; int k; for( k=0; kif(p[k]==data) { hitindex=k; break; } } return hitindex; } 

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!