Cache LRU (Least Recently Used) nglurug item sing ora ditusuk paling suwe nalika kapasitas kepenuhan. Design klasik nggabung hash map (O(1) look up) karo doubly linked list (O(1) nata ulang), menehi O(1) get lan put.
Desain loro struktur
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)
