/LFU

Least Frequently Used Cache implementation in O(1) + implementation contributed in python

Primary LanguagePythonMIT LicenseMIT

LFU Cache implementation

Here is a user friendly and easily understandable implementation of Least-Frequently-Used cache in python. It is based upon an amazing paper I got to read from a web-club. So here is my implementation of it ..

The other information about contributions can be found below :

NIT-K fork info :

Greetings from Web Club at NITK! :) We are looking to implement a cache described in the paper titled An O(1) algorithm for implementing the LFU cache eviction scheme. The aim is to provide the user with a user-friendly, well-documented library for use in their own programs.

Goal

The project aims to build a library which will provide a cache implementation through an API which provides the following basic functions:

  • Import the cache/library module into a program.
  • Initialize an empty cache.
  • Insert an item into the cache.
  • Lookup for an item.
  • Remove an existing item from the cache.

Contributing

  • If you are looking to contribute code, kindly look at the CONTRIBUTING.md file for information as to how to contribute to the repository!

  • If you are implementing the above logic in a programming language X, make sure you name your git branch as X and raise a PR for the same. If it already exists, try making it better!

  • Benchmark your programs against a test suite. We will be adding the module soon. Comparing different implementations hence becomes easier.

  • If there are any improvements, raise issues. Try to not ping specific members since some of us might be busy. We will respond soon.

LICENSE