arraystack

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2021 License: MIT Imports: 2 Imported by: 1

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 New

func New() *Stack

New 创建一个Stack

func (*Stack) Clear

func (st *Stack) Clear()

Clear 清空栈数据

func (*Stack) Empty

func (st *Stack) Empty() bool

Empty 如果空栈返回true

func (*Stack) Peek

func (st *Stack) Peek() (interface{}, bool)

Peek 相当与栈顶

func (*Stack) Pop

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

Pop 出栈

func (*Stack) Push

func (st *Stack) Push(v interface{})

Push 压栈

func (*Stack) Size

func (st *Stack) Size() uint

Size 数据量

func (*Stack) String

func (st *Stack) String() string

String 从左到右 左边第一个表示Top 如链表 a(top)->b->c 为了兼容其他栈

func (*Stack) Values

func (st *Stack) Values() []interface{}

Values 同上

Jump to

Keyboard shortcuts

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