lru

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2020 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 LRUCache

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

func NewLRUCache

func NewLRUCache(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 LRUListCache

type LRUListCache struct {
	HashMap map[int]*Node
	// contains filtered or unexported fields
}

func NewLRUListCache

func NewLRUListCache(capacity int) LRUListCache

func (*LRUListCache) Get

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

func (*LRUListCache) Put

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

type Node

type Node struct {
	Key   int
	Value int
	// contains filtered or unexported fields
}

type Pair

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

Jump to

Keyboard shortcuts

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