dsutils

package module
v0.0.0-...-735ead8 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2023 License: MIT Imports: 1 Imported by: 0

README

dsutils

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Stack

type Stack[T any] []T

Stack is a generic stack implementation.

func NewStack

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

NewStack returns a new stack.

func (*Stack[T]) Clear

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

Clear clears the stack.

func (*Stack[T]) IsEmpty

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

IsEmpty returns true if the stack is empty.

func (*Stack[T]) Len

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

Len returns the length of the stack.

func (*Stack[T]) Pop

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

Pop removes and returns the last element of the stack.

func (*Stack[T]) Push

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

NewStack returns a new stack.

func (*Stack[T]) Vector

func (s *Stack[T]) Vector() []string

String returns a string vector representation of all elements in stack.

Directories

Path Synopsis
cmd
pkg

Jump to

Keyboard shortcuts

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