MCPcopy Index your code
hub / github.com/TheAlgorithms/Go / eliminate

Method eliminate

cache/lfu.go:120–127  ·  view source on GitHub ↗

eliminate clear the least frequently operated element

()

Source from the content-addressed store, hash-verified

118
119// eliminate clear the least frequently operated element
120func (c *LFU) eliminate() {
121 l := c.freqMap[c.minFreq]
122 e := l.Back()
123 obj := e.Value.(item)
124 l.Remove(e)
125
126 delete(c.itemMap, obj.key)
127}

Callers 1

PutMethod · 0.95

Calls 2

BackMethod · 0.45
RemoveMethod · 0.45

Tested by

no test coverage detected