stack

package
v0.0.0-...-10bc058 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2021 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 MinStack

type MinStack struct {
	Stack []int
	Min   []int
}

用一个辅助栈,记录 push 一个元素 x 进去时,当前栈的最小值 y,当 pop 时 x 和 y 一起出

func Constructor

func Constructor() MinStack

* initialize your data structure here.

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