_09_stack_on_list

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 ListStack

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

func NewListStack

func NewListStack() *ListStack

初始化一个空栈,栈顶指针为nil

@return *ListStack

func (*ListStack) IsEmpty

func (this *ListStack) IsEmpty() bool

func (*ListStack) Pop

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

func (*ListStack) Print

func (this *ListStack) Print()

func (*ListStack) Push

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

入栈操作 ,链栈不存在栈满的情况,如果内存不足

@receiver this
@param interface{}

type ListStackInterface

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

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

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

	// 打印栈
	Print()
}

type Node

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

Jump to

Keyboard shortcuts

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