lfu_cache

package
v0.0.0-...-276c0a7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 20, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

type Item struct {
	Key          int
	Val          int
	Index        int
	Freq         int
	LastAccessAt int
}

type ItemHeap

type ItemHeap []*Item

func (ItemHeap) Len

func (h ItemHeap) Len() int

func (ItemHeap) Less

func (h ItemHeap) Less(i, j int) bool

func (*ItemHeap) Pop

func (h *ItemHeap) Pop() any

func (*ItemHeap) Push

func (h *ItemHeap) Push(x any)

func (ItemHeap) Swap

func (h ItemHeap) Swap(i, j int)

type LFUCache

type LFUCache struct {
	// contains filtered or unexported fields
}

func Constructor

func Constructor(capacity int) LFUCache

func (*LFUCache) Get

func (l *LFUCache) Get(key int) int

func (*LFUCache) Put

func (l *LFUCache) Put(key int, value int)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL