mirror of
https://github.com/cubixle/playground.git
synced 2026-04-24 19:54:45 +01:00
adding readmes
This commit is contained in:
4
README.md
Normal file
4
README.md
Normal file
@@ -0,0 +1,4 @@
|
||||
# Playground
|
||||
|
||||
This is an attempt to organise all the random bit of code I've written over the years.
|
||||
|
||||
14
lru/README.md
Normal file
14
lru/README.md
Normal file
@@ -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)
|
||||
```
|
||||
@@ -1,24 +0,0 @@
|
||||
mode: set
|
||||
github.com/cubixle/lru/lru.go:11.31,17.2 1 1
|
||||
github.com/cubixle/lru/lru.go:19.40,21.9 2 1
|
||||
github.com/cubixle/lru/lru.go:21.9,23.3 1 0
|
||||
github.com/cubixle/lru/lru.go:25.2,25.14 1 1
|
||||
github.com/cubixle/lru/lru.go:25.14,27.3 1 0
|
||||
github.com/cubixle/lru/lru.go:29.2,29.15 1 1
|
||||
github.com/cubixle/lru/lru.go:32.38,34.9 2 1
|
||||
github.com/cubixle/lru/lru.go:34.9,39.23 3 1
|
||||
github.com/cubixle/lru/lru.go:39.23,46.4 4 1
|
||||
github.com/cubixle/lru/lru.go:48.3,48.9 1 1
|
||||
github.com/cubixle/lru/lru.go:51.2,52.23 2 0
|
||||
github.com/cubixle/lru/lru.go:68.22,70.2 1 1
|
||||
github.com/cubixle/lru/lru.go:72.37,73.19 1 1
|
||||
github.com/cubixle/lru/lru.go:73.19,78.3 3 1
|
||||
github.com/cubixle/lru/lru.go:80.2,85.39 5 1
|
||||
github.com/cubixle/lru/lru.go:88.50,97.2 3 1
|
||||
github.com/cubixle/lru/lru.go:99.32,100.14 1 1
|
||||
github.com/cubixle/lru/lru.go:100.14,102.3 1 0
|
||||
github.com/cubixle/lru/lru.go:104.2,108.17 4 1
|
||||
github.com/cubixle/lru/lru.go:108.17,110.3 1 0
|
||||
github.com/cubixle/lru/lru.go:113.29,116.2 2 1
|
||||
github.com/cubixle/lru/lru.go:118.24,120.18 2 1
|
||||
github.com/cubixle/lru/lru.go:120.18,123.3 2 1
|
||||
Reference in New Issue
Block a user