util

package
v0.0.0-...-8b28c38 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2023 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 Stack

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

func NewStack

func NewStack[T any]() *Stack[T]

NewStack creates a new Stack[T]

func (*Stack[T]) Length

func (s *Stack[T]) Length() int

Length returns the total number of elements on the stack.

func (*Stack[T]) Pop

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

Pop the top item of the stack and return it

func (*Stack[T]) Push

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

Push adds a value to the top of the stack.

func (*Stack[T]) Top

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

Top returns the item on the top of the stack

Jump to

Keyboard shortcuts

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