Computer Science, asked by sarkarsid, 9 months ago

Which Data Structure Should be used for implementing LRU cache?
Queue
Tree
stack
Graph​

Answers

Answered by prathibhareddyg09
10

Answer:

queue

Explanation:

which is implemented using a doubly linked list. The maximum size of the queue will be equal to the total number of frames available (cache size). The most recently used pages will be near front end and least recently pages will be near the rear end.

Answered by anjalin
0

LRU cache could easily be implemented through Queue Data Structure.

Explanation:

  • The Least Recently Used (LRU) cache is a type of cache driving technique which arranges data in order based on their usage.
  • Queue which is implemented through the doubly sided linked list.
  • The atmost size for the queue is same as the overall number of frames available to use in cache (cache size).
  • The least recently used page could be at near front end side and most recently used page that will be at near rear end side.

Hence, LRU cache could be easily implemented through Queue Data Structure.

Similar questions