◀ most recently usedleast recently used ▶
AlgoPlus//structures / caching
Read the theory

Caching · LRU Eviction

A small cache keeps recent keys; the least-recently-used is evicted first.

Capacity
3
Hits
0
Misses
0
Hit rate
Access sequence
Legend
Hit
Miss / load
Cached key
AI Tutor Workspace
In a nutshell
A cache is a small, fast store that keeps recently-used data close so repeat requests skip the slow source. When it fills up it must evict something; the LRU policy drops whatever hasn't been touched for the longest, betting that recently-used data will be wanted again soon.
Ready
Press play to begin the cinematic walkthrough.
A cache keeps recently-used data close. LRU bets that what you used last you'll use again — so the least-recently-used item is the first to go.
Key terms
Go deeper in the lesson
Read the full theory, intuition & complexity for Caching · LRU Eviction.