When a full cache receives a new key, remove the list's least-recently-used tail and insert the new key at the front.
Read the related guide · · Bookmark this unique URL with Ctrl/Cmd+D.
An LRU cache combines a key lookup table with an ordered list so reads and writes can refresh recency efficiently. Experiment with a small example and see each step update.
When a full cache receives a new key, remove the list's least-recently-used tail and insert the new key at the front.
Read the related guide · · Bookmark this unique URL with Ctrl/Cmd+D.