stack

package
v0.0.0-...-d9922dd Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2022 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 {
	Element []interface{}
}

func NewStack

func NewStack() *Stack

func (*Stack) Empty

func (stack *Stack) Empty() bool

是否为空

func (*Stack) Get

func (stack *Stack) Get(idx int) (value interface{})

返回指定索引的元素

func (*Stack) Pop

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

func (*Stack) Print

func (stack *Stack) Print()

打印

func (*Stack) Push

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

func (*Stack) Set

func (stack *Stack) Set(idx int, value interface{}) (err error)

修改指定索引的元素

func (*Stack) Size

func (stack *Stack) Size() int

Stack的size

func (*Stack) Swap

func (stack *Stack) Swap(other *Stack)

func (*Stack) Top

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

Jump to

Keyboard shortcuts

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