LeetCode-146 LRU算法(数据结构专题)
数据结构系列
题目链接:146. LRU 缓存机制https://leetcode-cn.com/problems/lru-cache/
解答:
#include <iostream>
#include <list>
#include <unordered_map>
// 该数据结构类似java中的LinkedHashMap
class LRUCache {
public:
using Value = std::pair<int, int>;
原创
2021-09-18 09:39:52 ·
149 阅读 ·
0 评论