Skip to content

GiacomoPirroneNEP/go-lru-cache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

go-lru-cache

Simple Least Recently Used Cache data structure implementation in Go(lang).

Initializing LRU Cache

// Makes a new LRU Cache of size 100
newLruCache := createLRU(100)

Getting Value From LRU Cache

// Gets element from LRU Cache with key of "key"
elem, err := newLRUCache.GetElem("key)
if err != nil {
  log.Println(err.Error)
}

Add Element To LRU Cache

// Adds element to LRU Cache with key "k" and value "v"
newLruCache.SetElem("k", "v")

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages