Questions tagged [lru]

LRU is a family of caching algorithms, where LRU stands for least recently used.

LRU is a family of caching algorithms, where LRU stands for least recently used. As the name implies, a cache discards the least recently used items from the cache, when the contents exceed a certain threshold. In this algorithm, writes are quite expensive, as you always need to write the change the usage information when you use an item.

More information at Wikipedia.

304 questions
-1
votes
1 answer

LRUCache Design

This question is pertaining to the design involved in building a LRUCache. The complete problem can be found here. Although the solution ends up using a doubly linked list due to best time complexity for adding, deleting and lookup a key value pair,…
-1
votes
1 answer

LRU java, java.lang.IndexOutOfBoundsException

I've just been looking at this for too long and can't seem to resolve the index out of bounds exception. what am I overlooking? for the inputs i use 3 frames, a length of 20 for the reference string, and the numbers are…
Sollus
  • 11
  • 1
  • 6
-1
votes
2 answers

Calculating page faults with Least Recently Used

I am new to memory management and page replacement algorithms. I found and printed a question about the Least Recently Used algorithm, but unfortunately, I cannot determine if my answer and thought process are correct. I am trying very hard to…
SamSmith
  • 167
  • 1
  • 3
  • 13
-1
votes
1 answer

LRU w/o Timestamps and HashMap - Java

I am new in programming in general and in Java in particular. I want to implement an LRU cache and would like to have O(1) complexity. I have seen some implementations in the Internet using a manually implemented doubly linked list for the cache…
1 2 3
20
21