gstack

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 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 GStack

type GStack[T any] struct {
	// contains filtered or unexported fields
}

func New

func New[T any](unsafe ...bool) *GStack[T]

New 创建栈

func (GStack[T]) Clear

func (s GStack[T]) Clear()

Clear 清空

func (*GStack[T]) First

func (s *GStack[T]) First() *T

First 获取第一个进入队列的项

func (GStack[T]) IsEmpty

func (s GStack[T]) IsEmpty() bool

IsEmpty 检查是否为空

func (GStack[T]) Last

func (s GStack[T]) Last() *T

Last 获取最后进入队列的项

func (*GStack[T]) Pop

func (s *GStack[T]) Pop() *T

Pop 出栈,为空时返回nil

func (*GStack[T]) Push

func (s *GStack[T]) Push(item T)

Push 入栈

func (GStack[T]) Size

func (s GStack[T]) Size() int

Size 堆栈大小

Jump to

Keyboard shortcuts

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