页式虚拟存储管理
distance[i]=100; i=0; while(p) { if(p->address==0) { flag=0;break; } p=p->next; i++; } if(!flag) { p->address=n; printf("Change the page %d\n",i+1); } else { while(q) { for(i=position;i<N;i++) { if(q->address==A[i]) distance[total]=i-position;} total++; q=q->next; } MAX=distance[0]; for(i=0;i<num;i++) { if(distance[i]>MAX) { MAX=distance[i]; order=i; } } printf("Change the page %d\n",order+1); i=0; while(p) { if(i==order) p->address=n; i++; p=p->next;