linkedliststack

package
v0.0.0-...-118d4d9 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2016 License: BSD-2-Clause Imports: 4 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
}

func New

func New() *Stack

Instantiates a new empty stack

func (*Stack) Clear

func (stack *Stack) Clear()

Removes all elements from the stack.

func (*Stack) Empty

func (stack *Stack) Empty() bool

Returns true if stack does not contain any elements.

func (*Stack) Peek

func (stack *Stack) Peek() (value interface{}, ok bool)

Returns top element on the stack without removing it, or nil if stack is empty. Second return parameter is true, unless the stack was empty and there was nothing to peek.

func (*Stack) Pop

func (stack *Stack) Pop() (value interface{}, ok bool)

Pops (removes) top element on stack and returns it, or nil if stack is empty. Second return parameter is true, unless the stack was empty and there was nothing to pop.

func (*Stack) Push

func (stack *Stack) Push(value interface{})

Pushes a value onto the top of the stack

func (*Stack) Size

func (stack *Stack) Size() int

Returns number of elements within the stack.

func (*Stack) String

func (stack *Stack) String() string

func (*Stack) Values

func (stack *Stack) Values() []interface{}

Returns all elements in the stack (LIFO order).

Jump to

Keyboard shortcuts

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