mirror of
https://github.com/cubixle/playground.git
synced 2026-04-30 15:08:48 +01:00
adding readmes
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
# LRU Cache
|
||||
|
||||
This is a simple implementation of a Least Recently Used (LRU) Cache in Go.
|
||||
|
||||
An LRU Cache will evict the oldest used key whenever the cache gets full.
|
||||
|
||||
Example usage
|
||||
```go
|
||||
capacity := 100
|
||||
cache := lru.NewCache(capacity)
|
||||
cache.Set("im a key", "im a value")
|
||||
val := cache.Get("im a key")
|
||||
println(val)
|
||||
```
|
||||
Reference in New Issue
Block a user