LRU Cache
HashMap + Doubly Linked List · O(1) get & put
Capacity
Reset
Key
Val
GET
PUT
0
/
3
Try:
Basic fill & evict
GET moves to MRU
Update existing key
Doubly Linked List
HEAD=MRU
TAIL=LRU
Cache is empty — try PUT(key, val)
HashMap
key → node pointer
Empty
Operation Log
No operations yet