stack

package
v0.0.0-...-db1a295 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Stack

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

func NewStack

func NewStack() *Stack

NewStack 创建一个栈

func (*Stack) BatchPush

func (stk *Stack) BatchPush(valList ...interface{}) bool

BatchPush 批量添加

func (*Stack) Empty

func (stk *Stack) Empty() bool

Empty 栈是否为空

func (*Stack) Len

func (stk *Stack) Len() int

Len 获取栈中元素个数

func (*Stack) Pop

func (stk *Stack) Pop() (interface{}, bool)

Pop 元素出栈

func (*Stack) Push

func (stk *Stack) Push(val interface{}) bool

Push 元素入栈

func (*Stack) Top

func (stk *Stack) Top() (interface{}, bool)

Top 获取栈顶元素

Jump to

Keyboard shortcuts

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