internal

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsNil added in v0.3.0

func IsNil[T any](instance T) bool

IsNil checks if the given instance of any type T is nil.

Types

type Stack

type Stack[TValue any] []TValue

Stack represents a last-in-first-out (LIFO) collection of items. It can be used to manage a set of elements with push and pop operations.

func MakeStack

func MakeStack[TValue any](initialValues ...TValue) Stack[TValue]

MakeStack creates and returns a new Stack initialized with the provided initial values. Useful for algorithm implementations needing LIFO structures.

func (*Stack[TValue]) Any

func (s *Stack[TValue]) Any() bool

Any determines if the stack contains at least one element, indicating it is not empty.

func (*Stack[TValue]) IsEmpty

func (s *Stack[TValue]) IsEmpty() bool

IsEmpty checks whether the stack is empty, which can help determine if there are any elements left to process.

func (*Stack[TValue]) Pop

func (s *Stack[TValue]) Pop() TValue

Pop removes and returns the item at the top of the stack, allowing for a LIFO retrieval of elements.

func (*Stack[TValue]) Push

func (s *Stack[TValue]) Push(value ...TValue)

Push appends one or more values to the top of the stack, allowing dynamic and flexible addition of elements.

Directories

Path Synopsis
tests

Jump to

Keyboard shortcuts

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