AI engineering glossary · Data structures algorithms

What is LRU cache?

LRU cache (also called least recently used cache): A fixed-size cache that, when full, removes the item that was used least recently. It is commonly built from a hash table plus a doubly linked list so both lookup and update take constant time.

Level: intermediateTopic: Data structures algorithms

LRU cache: an example

With capacity 3 holding pages A, B, C where A was used longest ago, adding D evicts A.

Related terms

More Data structures algorithms terms

Where you learn it

LRU cache is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.