day141

package
v0.0.0-...-36687a4 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrEmptyStack

func ErrEmptyStack() error

ErrEmptyStack is returned if the stack is empty.

func ErrInvalidStackID

func ErrInvalidStackID() error

ErrInvalidStackID is returned if the stack id is not either 0, 1, 2.

Types

type ThreeStacks

type ThreeStacks struct {
	// contains filtered or unexported fields
}

ThreeStacks represents 3-stacks using only a single underlying list to store values.

func (*ThreeStacks) Pop

func (ts *ThreeStacks) Pop(stackID int) (interface{}, error)

Pop removes and returns the most recent addition to the given stack.

func (*ThreeStacks) Push

func (ts *ThreeStacks) Push(val interface{}, stackID int) error

Push adds the Value to the top of the given stack.

Jump to

Keyboard shortcuts

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