stack

package
v0.0.0-...-eb2d200 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2018 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrEmptyStack is an error global to check if a stack is empty or not
	ErrEmptyStack = errors.New("Stack is empty")
)

Functions

This section is empty.

Types

type Stack

type Stack struct {
	Head *node
}

Stack structure. One member : a pointer of node that is the head of the Stack.

func (*Stack) IsEmpty

func (st *Stack) IsEmpty() bool

IsEmpty member function Check if stack is empty.

func (*Stack) Pop

func (st *Stack) Pop() (interface{}, error)

Pop Member function. Delete the head of the stack.

func (*Stack) Push

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

Push member function Add d (data) parameter to the stack.

Jump to

Keyboard shortcuts

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