structures

package
v0.0.0-...-4e73936 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 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 AllOne

type AllOne struct {
}

func AllOneConstructor

func AllOneConstructor() AllOne

* Initialize your data structure here.

func (*AllOne) Dec

func (this *AllOne) Dec(key string)

* Decrements an existing key by 1. If Key's value is 1, remove it from the data structure.

func (*AllOne) GetMaxKey

func (this *AllOne) GetMaxKey() string

* Returns one of the keys with maximal value.

func (*AllOne) GetMinKey

func (this *AllOne) GetMinKey() string

* Returns one of the keys with Minimal value.

func (*AllOne) Inc

func (this *AllOne) Inc(key string)

* Inserts a new key <Key> with value 1. Or increments an existing key by 1.

type LRUCache

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

func LRUConstructor

func LRUConstructor(capacity int) LRUCache

func (*LRUCache) Get

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

func (*LRUCache) Put

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

func (*LRUCache) RemoveOldest

func (this *LRUCache) RemoveOldest()

RemoveOldest 移除双向链表中访问时间最远的那一项

type MinStack

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

func MinStackConstructor

func MinStackConstructor() MinStack

func (*MinStack) GetMin

func (this *MinStack) GetMin() int

func (*MinStack) Pop

func (this *MinStack) Pop()

func (*MinStack) Push

func (this *MinStack) Push(x int)

func (*MinStack) Top

func (this *MinStack) Top() int

Jump to

Keyboard shortcuts

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