data_structure_design

package
v0.0.0-...-f550c6f Latest Latest
Warning

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

Go to latest
Published: May 12, 2023 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LFU

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

func (*LFU) Get

func (l *LFU) Get(key int) int

func (*LFU) Put

func (l *LFU) Put(key, val int)

type LRUCache

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

func NewLRU

func NewLRU(cap int) *LRUCache

func (*LRUCache) Get

func (l *LRUCache) Get(key int) (int, bool)

func (*LRUCache) Put

func (l *LRUCache) Put(key, val int)

func (*LRUCache) Size

func (l *LRUCache) Size() int

type MaxQueue

type MaxQueue struct {
	MonotoneQueue *MonotoneQueue
	// contains filtered or unexported fields
}

剑指 Offer 59 - II. 队列的最大值 (https://leetcode.cn/problems/dui-lie-de-zui-da-zhi-lcof)

func Constructor

func Constructor() MaxQueue

func (*MaxQueue) Max_value

func (this *MaxQueue) Max_value() int

func (*MaxQueue) Pop_front

func (this *MaxQueue) Pop_front() int

func (*MaxQueue) Push_back

func (this *MaxQueue) Push_back(value int)

type MonotoneQueue

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

monotone queue 单调队列

func (*MonotoneQueue) Max

func (q *MonotoneQueue) Max() int

func (*MonotoneQueue) Pop

func (q *MonotoneQueue) Pop(x int)

func (*MonotoneQueue) Push

func (q *MonotoneQueue) Push(x int)

Jump to

Keyboard shortcuts

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