LRU (Least Recently Used) cache, kapasiteye ulaştığında en uzun süredir erişilmemiş öğeyi çıkarır. Klasik tasarım, hash map (O(1) lookup) ile çift yönlü bağlı liste (O(1) yeniden sıralama) birleştirerek O(1) get ve put sağlar.
İki yapılı tasarım
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)
