Create a "least recently used" cache that evicts the least recently used item. The cache should be configured with a max size and should map from keys to values (enabling you to enter and retrieve a value associated with a certain key). When it is full, it should evict the item that has been utilised the least recently. Assume that the keys are integers and the values are strings.

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter8: Advanced Data Handling Concepts
Section: Chapter Questions
Problem 18RQ
icon
Related questions
Question

Create a "least recently used" cache that evicts the least recently used item. The cache should be configured with a max size and should map from keys to values (enabling you to enter and retrieve a value associated with a certain key). When it is full, it should evict the item that has been utilised the least recently. Assume that the keys are integers and the values are strings.

Expert Solution
steps

Step by step

Solved in 5 steps with 2 images

Blurred answer
Knowledge Booster
Properties of Different Architectures
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning