stack

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EmptyStackError = fmt.Errorf("Trying to pop an empty stack.")
View Source
var StackOverflowError = fmt.Errorf("Trying to push to a full stack.")

Functions

This section is empty.

Types

type SizedStack

type SizedStack[V any] struct {
	// contains filtered or unexported fields
}

func NewSizedStack

func NewSizedStack[V any](cap int) SizedStack[V]

func (SizedStack[V]) Cap

func (this SizedStack[V]) Cap() int

func (SizedStack[V]) Len

func (this SizedStack[V]) Len() int

func (*SizedStack[V]) Pop

func (this *SizedStack[V]) Pop() (V, error)

func (*SizedStack[V]) Push

func (this *SizedStack[V]) Push(vals ...V) error

type Stack

type Stack[V any] struct {
	// contains filtered or unexported fields
}

func NewStack

func NewStack[V any]() Stack[V]

func (Stack[V]) Len

func (this Stack[V]) Len() int

func (*Stack[V]) Pop

func (this *Stack[V]) Pop() (V, error)

func (*Stack[V]) Push

func (this *Stack[V]) Push(vals ...V)

Jump to

Keyboard shortcuts

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