MCPcopy Create free account
hub / github.com/TheAlgorithms/Go / LRU

Struct LRU

cache/lru.go:22–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20}
21
22type LRU struct {
23 dl *linkedlist.Doubly[any]
24 size int
25 capacity int
26 storage map[string]*linkedlist.Node[any]
27}
28
29// NewLRU represent initiate lru cache with capacity
30func NewLRU(capacity int) LRU {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected