Cache LRU (Least Recently Used) iotja l-element li ma kienx aċċessat għal aktar żmien meta tilħaq l-kapaċità. Id-disinn klassiku jgħaqqad hash map (lookup O(1)) ma doubly linked list (O(1) reordering), u jagħti O(1) get u put.
Disinn ta' żewġ strutturi
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)
