Image for LRU (Least Recently Used) Algorithm

LRU (Least Recently Used) Algorithm

The Least Recently Used (LRU) algorithm manages limited storage by removing the data that hasn't been accessed for the longest time. When space is needed for new information, LRU identifies and discards the item that was last used the furthest in the past, assuming it’s less likely to be needed soon. This approach helps keep the most relevant, recently-used data available, improving efficiency in systems like caches and memory management. Essentially, LRU mimics intuitive decision-making: if something hasn't been used recently, it’s a good candidate for removal.