n left LL D 1 2 3 1. Minimum Cache Capacity Given a list of n items accessed in sequence from a system, and a cache with Least Recently Used (LRU) replacement policy, the goal is to determine the minimum cache size required to ensure at least k requests hit the cache. If it is not possible to achieve k hits, return -1. Assume each item in the list has a size of 1 unit. Note: A cache following Least Recently Used (LRU) replacement policy is of fixed size and when it becomes full we will delete the value which is least recently used and insert a new value. Example Suppose n = 5, requests = ["item1", "item1", "item3", "item1", "item3"], and k = 1. 4 With size of cache as 1, we get:

Systems Architecture
7th Edition
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Stephen D. Burd
Chapter6: System Integration And Performance
Section: Chapter Questions
Problem 29VE
icon
Related questions
Question
Please check the answer and add explanation properly
n left
LL
D
1
2
3
1. Minimum Cache Capacity
Given a list of n items accessed in sequence from a system, and a cache
with Least Recently Used (LRU) replacement policy, the goal is to determine
the minimum cache size required to ensure at least k requests hit the
cache. If it is not possible to achieve k hits, return -1.
Assume each item in the list has a size of 1 unit.
Note: A cache following Least Recently Used (LRU) replacement policy is of
fixed size and when it becomes full we will delete the value which is least
recently used and insert a new value.
Example
Suppose n = 5, requests = ["item1", "item1", "item3", "item1", "item3"], and k
= 1.
4
With size of cache as 1, we get:
Transcribed Image Text:n left LL D 1 2 3 1. Minimum Cache Capacity Given a list of n items accessed in sequence from a system, and a cache with Least Recently Used (LRU) replacement policy, the goal is to determine the minimum cache size required to ensure at least k requests hit the cache. If it is not possible to achieve k hits, return -1. Assume each item in the list has a size of 1 unit. Note: A cache following Least Recently Used (LRU) replacement policy is of fixed size and when it becomes full we will delete the value which is least recently used and insert a new value. Example Suppose n = 5, requests = ["item1", "item1", "item3", "item1", "item3"], and k = 1. 4 With size of cache as 1, we get:
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781305627482
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781285196145
Author:
Steven, Steven Morris, Carlos Coronel, Carlos, Coronel, Carlos; Morris, Carlos Coronel and Steven Morris, Carlos Coronel; Steven Morris, Steven Morris; Carlos Coronel
Publisher:
Cengage Learning
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Operations Research : Applications and Algorithms
Operations Research : Applications and Algorithms
Computer Science
ISBN:
9780534380588
Author:
Wayne L. Winston
Publisher:
Brooks Cole
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage