Overview
An LRU cache combines a hash table for lookup with an ordered list that tracks recent access.
Evicts the least recently used item when capacity is exceeded.
Compact metadata for implementation and discovery.
An LRU cache combines a hash table for lookup with an ordered list that tracks recent access.
Quick facts
Runtime and memory behavior at a glance.
Best
O(1)
Average
O(1)
Worst
O(1)
Space
O(capacity)
evict item with oldest access timeRemoves the least recently used item when the cache is full.
Show the structure layout and how operations move through or update it.
LRU Cache should be used with the assumptions and tradeoffs of cache in mind.
What each reference supports for this entry.
Data-structures reference for LRU cache organization, recency order maintenance, and hash/list update operations.
Reference for LRU replacement policy, recency-based eviction, and practical cache-management behavior.
Open sourceGood next jumps from the relationship graph, ranked for useful discovery.
LRU caches commonly combine hash-table lookup with an order-maintaining list or queue.