lru

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 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

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

func New

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

func (*LRUCache[K, V]) Get

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

func (*LRUCache[K, V]) Put

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

type Node

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