stack

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2022 License: MIT Imports: 1 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 struct {
	// contains filtered or unexported fields
}

Stack is a thread-safe LIFO data structure.

func NewStack

func NewStack() *Stack

NewStack returns a new Stack.

func (*Stack) Len

func (s *Stack) Len() int

Len returns the number of elements in the stack.

func (*Stack) Pop

func (s *Stack) Pop() any

Pop removes and returns the element at the top of the stack.

func (*Stack) Push

func (s *Stack) Push(a any)

Push adds an element to the top of the stack.

Jump to

Keyboard shortcuts

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