Sebuah cache LRU (Least Recently Used) mengeluarkan item yang tidak diakses paling lama ketika mencapai kapasitas. Desain klasik menggabungkan hash map (O(1) lookup) dengan doubly linked list (O(1) penyusunan ulang), memberikan O(1) get dan put.
The two-structure design
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)
