018 · MIT 6.006 — LRU 缓存
| 项目 | 内容 |
|---|---|
| 学校 | MIT |
| 课程 | MIT 6.006 Introduction to Algorithms |
| 方向 | 数据结构 / Data structures |
| 语言 | Python |
| 难度 | 进阶 / Intermediate |
| 预计耗时 | 3–6 天 |
为什么收录
LRU 缓存是哈希表与双向链表结合的经典题:O(1) 完成读写与淘汰,是理解数据结构组合的绝佳案例。
English: A carefully chosen capstone that builds transferable reasoning skills through hands-on implementation.
实测结果
- get(1) 后顺序从 [2,1] 变为 [1,2],证明命中被提升为 MRU;put(3) 淘汰了 LRU 的键 2。
- 详见 05-调试与测试.md