实验4 内存管理学校:F J U T 学号:3 1319 0 322 9 班级:计算机1 302 姓名:姜峰注:其中 LFU 与N R U算法运行结果可能与其她人不同,只就是实现方式不同,基本思路符合就可以.一. 实验学时与类型学时:2,课外学时:自定实验类型:设计性实验二. 实验目得模拟实现请求页式存储管理中常用页面置换算法,理会操作系统对内存得调度管理.三. 实验内容要求:各算法要给出详细流程图以及执行结果截图。假设有一程序某次运行访问得页面依次就是 :0,1,2,4,3,4,5,1,2,5,1,2,3,4,5,6,请给出采纳下列各页面置换算法时页面得换进换出情况,并计算各调度算法得命中率(命中率=非缺页次数/总访问次数),初始物理内存为空,物理内存可在4~2 0 页中选择.(1) FI FO:最先进入得页被淘汰;(2) LRU:最近最少使用得页被淘汰;(3) OPT:最不常用得页被淘汰;(选做)(4) LFU:访问次数最少得页被淘汰(LFU)。(选做) 源代码:#i nclude 〈s t d i o、h>#inclu de <s tring、h〉#inc l ude 〈l i mi t s、h>#in c l u de <ma lloc、h〉#d e fine MAXNU M 100struct Ph y_Memory{ //定义一个物理内存结构体 ch a r Page; i n t tim e;};c h ar *O u t Put;stru ct Phy_Memor y *Phy_Pa ge;voi d Prin t(ch a r *Pa g eStr,i nt Ph y_P ag eNum,i nt abs e nce){ //打印图解函数 in t i,j; for(i=0;i<s tr l en(P ageStr);i++)pr i ntf(”%c ”,*(P a geStr+i));printf("\n”); fo r(i=0;i〈str l en(PageS tr);i++)prin t f(”——");p r in tf("\n”); fo r(i=0;i<P hy_PageN u m;i++){ for(j=0;j〈str le n(P a geStr);j++){ printf("%c ",*(OutPu t+i*strlen(Pag e Str)+j)); } printf("\n”); } p rintf(”缺页数为:%d\n”,abs e nce); prin tf("总访问次数为:%d\n",strl en(PageStr)); prin tf("缺页率为 %、2f\n",(doub l e)ab s ence/s t r l en(Pa geStr));}in t IsExis t(char *Te mp,i n t Ph y_P a geNum){ //推断某页面就是否存在于物理内存中 int i;...