Data/Structure/Cache/LRU
Properties
LRU Cache Data Structure | Interview Cake
- A Least Recently Used (LRU) Cache organizes items in order of use, allowing you to quickly identify which item hasn't been used for the longest amount of time.
- Picture a clothes rack, where clothes are always hung up on one side. To find the least-recently used item, look at the item on the other end of the rack.
- Under the hood, an LRU cache is often implemented by pairing a doubly linked list with a hash map.