Intermediate Data Structures & Algorithms
Q55 / 100

What is the LRU cache and which data structures implement it efficiently?

Correct! Well done.

Incorrect.

The correct answer is B) Least Recently Used: implemented with a hash map + doubly linked list for O(1) get and put

B

Correct Answer

Least Recently Used: implemented with a hash map + doubly linked list for O(1) get and put

Explanation

LRU cache evicts the least recently used item. A hash map gives O(1) lookup by key, and a doubly linked list maintains recency order with O(1) move-to-front on access.

Progress
55/100