stack

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 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[T num.Q] struct {
	// contains filtered or unexported fields
}

func New

func New[T num.Q]() (newStack *Stack[T])

New 空构造

func NewFromSlice

func NewFromSlice[T num.Q](sourceSlice []T) (newStack *Stack[T])

从切片构造

func (*Stack[T]) Clear

func (this *Stack[T]) Clear()

清空

func (*Stack[T]) DeepEqual

func (this *Stack[T]) DeepEqual(another *Stack[T]) bool

值判等,内容视图判等

func (*Stack[T]) IsEmpty

func (this *Stack[T]) IsEmpty() bool

判空

func (*Stack[T]) Pop

func (this *Stack[T]) Pop() (element T)

出栈 警告:不会检查自身是否为空,请调用方自行检查

func (*Stack[T]) Push

func (this *Stack[T]) Push(e T)

压栈

func (*Stack[T]) Size

func (this *Stack[T]) Size() int

获取已用容量

func (*Stack[T]) String

func (this *Stack[T]) String() string

序列化方法

func (*Stack[T]) Top

func (this *Stack[T]) Top() (element T)

获取栈顶元素

Jump to

Keyboard shortcuts

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