_08_stack_on_array

package
v0.0.0-...-6d07767 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SqStack

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

SqStack 顺序栈,数组实现

func NewSqStack

func NewSqStack(capacity int) *SqStack

初始化操作,建立一个空栈,栈顶指针为-1

@param capacity
@return *SqStack

func (*SqStack) IsEmpty

func (this *SqStack) IsEmpty() bool

func (*SqStack) Pop

func (this *SqStack) Pop() interface{}

func (*SqStack) Print

func (this *SqStack) Print()

func (*SqStack) Push

func (this *SqStack) Push(element interface{})

type SqStackInterface

type SqStackInterface interface {
	// 栈是否为空
	//  @return bool
	IsEmpty() bool

	// 进栈操作
	//  @param interface{}
	Push(interface{})

	// 出栈操作
	//  @return interface{}
	Pop() interface{}

	// 打印栈
	Print()
}

Jump to

Keyboard shortcuts

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