lc0146

package
v0.0.0-...-38cfe7b Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 License: MIT Imports: 0 Imported by: 0

README

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheProvider

type CacheProvider interface {
	Get(int) int
	Put(int, int)
}

func NewDefaultCacheProvider

func NewDefaultCacheProvider(capacity int) CacheProvider

func NewSingleValueCacheProvider

func NewSingleValueCacheProvider() CacheProvider

type EmptyCacheProvider

type EmptyCacheProvider bool

func (EmptyCacheProvider) Get

func (c EmptyCacheProvider) Get(_ int) int

func (EmptyCacheProvider) Put

func (c EmptyCacheProvider) Put(_ int, _ int)

type LRUCache

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

func Constructor

func Constructor(capacity int) LRUCache

func (*LRUCache) Get

func (c *LRUCache) Get(key int) int

func (*LRUCache) Put

func (c *LRUCache) Put(key int, value int)

type Node

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

func NewNode

func NewNode(key int, value int) *Node

Jump to

Keyboard shortcuts

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