Skip to content

Minimal C++ LRU cache using a linked-list and a map

License

Notifications You must be signed in to change notification settings

vicentebolea/llcache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

llcache

Minimal C++ LRU cache using a linked-list and a map

  • STATUS: Build Status

DESCRIPTION

This Lru map is using a hashtable+doublylinkedlist where:

  • The hash table will store a pointer of each element in the list.
  • The linkedlist will be use as lru linkedlist with a pair of key and value.

TIME COMPLEXITY

Here is described the time complexities of each functions:

  • insert: O(1) (amortized time)
  • lookup: O(1)

These complexities will be in the best case since the hash table will may rehash sometimes and in each rehash it will take O(n + buckets).

AUTHOR

Vicente Adolfo Bolea Sanchez vicente.bolea@gmail.com

About

Minimal C++ LRU cache using a linked-list and a map

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published