设为首页 加入收藏

TOP

LRU的C++的简单实现
2015-07-20 17:51:35 来源: 作者: 【 】 浏览:1
Tags:LRU 简单 实现

class LRUCache提供两个接口:get(int key)和set(int key,value)

#include
  
   

using namespace std;



class LRUCache{
public:
    LRUCache(int cap):current(0),capacity(cap){
        A=new node[cap];
    }
    int get(int key) {
        for(int i=0;i
   
    
测试:


】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇uva 11651 - Krypton Number Syst.. 下一篇hdu 4970 树状数组 “改段求段”

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: