stack

package module
v0.0.0-...-db1a295 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2021 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 interface {
	// Push 添加一个元素
	Push(interface{}) bool
	// BatchPush 批量添加
	BatchPush(...interface{}) bool
	// Pop 弹出栈顶元素
	Pop() (interface{}, bool)
	// Top 获取栈顶元素
	Top() (interface{}, bool)
	// Empty 栈为空
	Empty() bool
	// Len 已使用大小
	Len() int
}

func NewStack

func NewStack(cap int) Stack

NewStack 创建一个栈 if cap <= 0 return 无固定容量的栈 else return 固定容量的栈

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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