stack

package
v1.0.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Stack

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

func (*Stack[T]) IsEmpty

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

IsEmpty check if stack is empty

func (*Stack[T]) MustPop

func (s *Stack[T]) MustPop() T

func (*Stack[T]) Peek

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

Peek returns the top element of the stack without removing it.

func (*Stack[T]) Pop

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

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

func (*Stack[T]) Push

func (s *Stack[T]) Push(str 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