stack

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2020 License: BSD-3-Clause 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 []interface{}

Stack is a generic stack implementation. Not thread-safe.

func New

func New() Stack

New empty Stack

func (*Stack) Len

func (st *Stack) Len() int

Len returns the length of the stack

func (*Stack) Peek

func (st *Stack) Peek() (e interface{})

Peek at the most recent element

func (*Stack) Pop

func (st *Stack) Pop() (e interface{})

Pop an element

func (*Stack) Push

func (st *Stack) Push(e interface{})

Push an element, will be false if stack was improperly initialized

Jump to

Keyboard shortcuts

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