LRU (Least Recently Used) cache izloči element, ki se ga ni dostopalo najdlje časa, ko doseže kapaciteto. Klasični dizajn kombinira hash map (O(1) lookup) z dvovezno povezano listo (O(1) preureditev), kar daje O(1) get in put.
Dizajn z dvema strukturama
HashMap: key -> node DLL (recency order):
MRU <-> ... <-> LRU
get/put: map finds node move touched node to front (MRU)
in O(1); DLL splices it evict the tail (LRU) when full
to the front in O(1)
