stack

package
v0.2.12 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2024 License: MIT Imports: 0 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArrayStack

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

func (*ArrayStack[T]) All

func (s *ArrayStack[T]) All() []T

func (*ArrayStack[T]) Clear

func (s *ArrayStack[T]) Clear()

func (*ArrayStack[T]) Len

func (s *ArrayStack[T]) Len() int

func (*ArrayStack[T]) Peek

func (s *ArrayStack[T]) Peek() (v T)

func (*ArrayStack[T]) Pop

func (s *ArrayStack[T]) Pop() (v T)

func (*ArrayStack[T]) Push

func (s *ArrayStack[T]) Push(v T)

type Stack

type Stack[T any] interface {
	Push(v T)
	Pop() T
	Peek() T
	Clear()
	Len() int
	All() []T
}

Stack is the FILO container helps holding values

func NewArrayStack

func NewArrayStack[T any](cap int) Stack[T]

Jump to

Keyboard shortcuts

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