stack

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: AGPL-3.0 Imports: 1 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
}

Stack 栈结构

func NewStack

func NewStack() *Stack

NewStack 创建新的栈

func (*Stack) Empty

func (stack *Stack) Empty() bool

Empty 判断是否为空

func (*Stack) Len

func (stack *Stack) Len() int

Len 获取栈的深度

func (*Stack) Peak

func (stack *Stack) Peak() interface{}

Peak 获取栈顶,但是不弹出

func (*Stack) Pop

func (stack *Stack) Pop() interface{}

Pop 获取栈顶,弹出

func (*Stack) Push

func (stack *Stack) Push(value interface{})

Push 压入栈顶

Jump to

Keyboard shortcuts

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