https://github.com/zipcodecore/lru-capable-java
build code which implements an idea in a a scientific paper.
https://github.com/zipcodecore/lru-capable-java
Last synced: 10 months ago
JSON representation
build code which implements an idea in a a scientific paper.
- Host: GitHub
- URL: https://github.com/zipcodecore/lru-capable-java
- Owner: ZipCodeCore
- Created: 2022-01-04T21:51:33.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2022-01-04T21:51:35.000Z (almost 4 years ago)
- Last Synced: 2025-01-08T12:41:27.049Z (12 months ago)
- Size: 197 KB
- Stars: 0
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# LRU-capable
## Leastways: Are You Capable?
Can you implement this alogrithm in Java? It is a PDF of scientific paper, with plenty of clarity of how the technique works.
Write a battery of tests to prove your code works.
Check out the pdf, and good luck.
You're looking to build a Java class, and some tests that implement this idea.
We think you can. Maybe.
----
### An O(1) algorithm for implementing the LFU cache eviction scheme
#### Prof. Ketan Shah Anirban Mitra Dhruv Matani August 16, 2010
### Abstract
Cache eviction algorithms are used widely in operating systems, databases and other systems that use caches to speed up execution by caching data that is used by the application.
There are many policies such as MRU (Most Recently Used), MFU (Most Frequently Used), LRU (Least Recently Used) and LFU (Least Frequently Used) which each have their advantages and drawbacks and are hence used in specific scenarios.
By far, the most widely used algorithm is LRU, both for its O(1) speed of operation as well as its close resemblance to the kind of behaviour that is expected by most applications. The LFU algorithm also has behaviour desirable by many real world workloads. However, in many places, the LRU algorithm is is preferred over the LFU algorithm because of its lower run time complexity of O(1) versus O(logn).
We present here an LFU cache eviction algorithm that has a runtime complexity of O(1) for all of its operations, which include insertion, access and deletion(eviction).