Skip to content

MeCKodo/LFU-O1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LFU-O1

CircleCI npm npm

Implement LFU O(1) time

Install

npm install lfu-o1 -S

How to use

const cache = new LFUCache(2);

cache.put(1, 1);
cache.put(2, 2);

cache.get(1); // 1
cache.get(2); // 2
cache.get(2); // 2

cache.put(3, 3); // remove 1

cache.get(1); // -1
cache.get(3); // 3

Releases

No releases published

Packages

No packages published