lru

package
v1.10.7 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2024 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LRUCache added in v1.10.5

type LRUCache[K comparable, V any] struct {
	Head, Tail *Node[K, V]
	// contains filtered or unexported fields
}

func New added in v1.10.5

func New[K comparable, V any](capacity int) *LRUCache[K, V]

func (*LRUCache[K, V]) Get added in v1.10.5

func (l *LRUCache[K, V]) Get(key K) (V, bool)

func (*LRUCache[K, V]) Put added in v1.10.5

func (l *LRUCache[K, V]) Put(key K, val V)

type Node added in v1.10.5

type Node[K comparable, V any] struct {
	Key        K
	Val        V
	Prev, Next *Node[K, V]
}

Jump to

Keyboard shortcuts

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