_41_160

package
v0.0.0-...-85ba926 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	L, R = &LRUCache{Key: -1, Val: -1}, &LRUCache{Key: -1, Val: -1}
)

//map记录键值是否存在,双链表保证O(1)删除(最左边是最近用过的,最右边是不常用的值)

Functions

This section is empty.

Types

type LRUCache

type LRUCache struct {
	Key, Val    int
	Left, Right *LRUCache
}

func Constructor

func Constructor(capacity int) LRUCache

func (*LRUCache) Get

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

func (*LRUCache) Put

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

type ListNode

type ListNode struct {
	Val  int
	Next *ListNode
}

type MinStack

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

func Constructor

func Constructor() MinStack

func (*MinStack) GetMin

func (ms *MinStack) GetMin() int

func (*MinStack) Pop

func (ms *MinStack) Pop()

func (*MinStack) Push

func (ms *MinStack) Push(val int)

func (*MinStack) Top

func (ms *MinStack) Top() int

Jump to

Keyboard shortcuts

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