LRU 缓存

LeetCode Hot 100 链表
难度: 中等

题目描述

实现一个 LRU 缓存机制。

解题思路

使用哈希表和双向链表。哈希表用于快速访问,双向链表用于记录使用顺序。时间复杂度为 O(1)。