float fifo( const int userMem, const int pageAddrStream[] ); //先进先出的算法 float lru( const int userMem, const int pageAddrStream[] ); //最近最久未使用算法 float opt( const int userMem, const int pageAddrStream[] ); //最佳淘汰算法 float nru( const int userMem, const i
本文实例讲述了Python实现的最近最少使用算法。分享给大家供大家参考。具体如下:
# lrucache.py -- a simple LRU (Least-Recently-Used) cache class
# Copyright 2004 Evan Prodromou
# Licensed under the Academic Free License 2.1
# Licensed for ftputil under the revised BSD license
# with per