Skip to content
UPEEC

LRU Cache

A fixed-size cache that evicts the Least Recently Used item.

Intermediate
Comments 0

Hash map + doubly linked list gives O(1)O(1) get and put. Python: functools.lru_cache or OrderedDict.move_to_end.

Spotted a mistake or want to add detail? Suggest an improvement — Content Contributors' edits are reviewed by editors before they go live.

Discussion (0)

Sign in or join free to ask questions and discuss this topic.