hits
0
misses
0
evictions
0
hit ratio
—
// click a key to call
cache.get(key)
HashMap
key → node
no order at all.
that is what the list is for.
Doubly-linked list · by recency
LRU
▲ MRU end — just used
LRU end — evict here ▼
A capacity-3 cache, drawn as real pointers
Click a key below to call
cache.get(key)
. A hit slides the node to the MRU end; a miss loads it and, if the cache is full, the tail dies.
▶ Replay trace
↺ Reset
▸
Replay under 🔁 LRU, reset, then replay under 📊 LFU — a different key dies.