Skip to content

drish/lrucache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lrucache

Build Status

A Simple java implementation of a LRU Cache, it's backed by a doubly linked list and a hash map for O(1) operations.

Usage

// a cache with 5000 objects capacity;
LRUCache cache = new LRUCache(5000);
int id = 4; // some id
Guitar gibson = new Guitar();

cache.addObject(id, gibson);

cache.getMostAccessedObject(); // gibson
cache.getObject(id); // gibson

About

A Java implementation of a LRU Cache.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages