LRU
// 最近最少缓存算法(key,value)
class LRUCache
{
private:
// 1、list双向链表
std::list<std::pair< int, int> > _list;
// 2、使用unordered_map
// 由于需要快速定位链表的结点,故在map中使用value字段来存储链表的结点,这里是使用了迭代器。
std::unordered_map< int, std::list<std::.
转载
2021-03-24 13:49:27 ·
135 阅读 ·
0 评论