containers

package
v0.255.0 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2024 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Set added in v0.178.0

type Set[T comparable] struct {
	// contains filtered or unexported fields
}

func MakeSet added in v0.178.0

func MakeSet[T comparable](s ...T) Set[T]

func (*Set[T]) Add added in v0.178.0

func (s *Set[T]) Add(v T)

func (Set[T]) Has added in v0.178.0

func (s Set[T]) Has(v T) bool

func (Set[T]) ToSlice added in v0.178.0

func (s Set[T]) ToSlice() []T

type Stack

type Stack[T any] []T

func (*Stack[T]) IsEmpty

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

IsEmpty check if stack is empty

func (*Stack[T]) Last

func (s *Stack[T]) Last() (T, bool)

Last returns the last stack element

func (*Stack[T]) Pop

func (s *Stack[T]) Pop() (T, bool)

Pop remove and return top element of stack. Return false if stack is empty.

func (*Stack[T]) Push

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

Push a new value onto the stack

Jump to

Keyboard shortcuts

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