LFU-O1

implement LFU O(1) time

MIT License

Downloads
7
Stars
6

LFU-O1

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
Package Rankings
Top 20.62% on Npmjs.org
Badges
Extracted from project README
CircleCI npm npm