DATA STRUCTURES LAB

LRU Cache Visualizer

Hash Map + Doubly Linked List

Interactive Simulator
01/06

LIVE MEMORY MODEL

A cache is a small memory with a strict rule: the oldest untouched item leaves first.

MODELMap + List
Capacity3Maximum Items
Current size00% full
Operations0GET + PUT calls
Hit rate0%Successful GETs

CONFIGURATION

Cache controls

+

PUT(key, value)

⌕

GET(key)

Ready. Add an Item using PUT to begin.

LINKED LIST / LIVE MEMORY

Doubly Linked List

Head = Most Recently Used · Tail = Least Recently Used

MRUNodeLRU
HEAD →← TAIL
Most recently usedLeast recently used

Each node stores prev and next pointers. The arrows represent the actual list connections.

EXECUTION TRACEWaiting for an operation

Run a GET or PUT to see the cache change.

DIRECT ACCESS

Hash Map

Key → Node reference

0 entries
KeyValueNode reference

ACTIVITY

Operation log

Recent cache events

INTERNAL STATE

Pointer inspector

Headnull
Tailnull
Hits0
Misses0

Run GET or PUT to inspect a node.

GUIDED PRACTICE

Step-by-step example

Click a step to execute it.