文件名称:LRU-Cache
介绍说明--下载内容均来自于网络,请自行研究使用
设计和实现一个数据结构最近最少使用(LRU)缓存。它应该支持以下操作:获取和设置。 得到(关键)得到的价值(永远是积极的)关键如果键存在于缓存中,否则返回1。 集(关键字,值)——设置或插入的值如果不是已经存在的关键。当缓存达到容量,应该最近最少使用项失效前插入一个新项。-Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and set.
get(key)- Get the value (will always be positive) of the key if the key exists in the cache, otherwise return-1.
set(key, value)- Set or insert the value if the key is not already present. When the cache reached its capacity, it should invalidate the least recently used item before inserting a new item.
get(key)- Get the value (will always be positive) of the key if the key exists in the cache, otherwise return-1.
set(key, value)- Set or insert the value if the key is not already present. When the cache reached its capacity, it should invalidate the least recently used item before inserting a new item.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
LRU Cache.CPP