stack

package
v0.0.0-...-19a3f40 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

type Item interface{}

范型

type Stack

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

func NewNumberStack

func NewNumberStack(numbers []int) *Stack

func NewStack

func NewStack() *Stack

构建函数

func (*Stack) Clear

func (s *Stack) Clear()

func (*Stack) ForEach

func (s *Stack) ForEach(fn func(Item))

js 遍历

func (Stack) IsEmpty

func (s Stack) IsEmpty() bool

空的栈

func (*Stack) Len

func (s *Stack) Len() int

func (*Stack) Peek

func (s *Stack) Peek() Item

func (*Stack) Pop

func (s *Stack) Pop() Item

出栈, 弹出 去除切片尾部元素, 然后删除

func (*Stack) Push

func (s *Stack) Push(item Item)

入栈,压栈

func (Stack) Sort

func (s Stack) Sort()

排序的方法

Jump to

Keyboard shortcuts

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