stack

package
v0.0.0-...-b892b76 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2017 License: MIT Imports: 1 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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
}

Stack is a generic, synchronised implementation of a LIFO structure.

func New

func New() *Stack

New creates a new Stack.

func (*Stack) Clear

func (s *Stack) Clear()

Clear removes all elements from the stack.

func (*Stack) IsEmpty

func (s *Stack) IsEmpty() bool

IsEmpty returns wheter the stack ontains no elements.

func (*Stack) Len

func (s *Stack) Len() int

Len returns the size of the Stack.

func (*Stack) Pop

func (s *Stack) Pop() interface{}

Pop removes the element at the top of the Stack and returns it.

func (*Stack) Push

func (s *Stack) Push(data interface{})

Push adds a new element onto the Stack.

func (*Stack) Top

func (s *Stack) Top() interface{}

Top returns the element at the top of the Stack, without removing it.

Jump to

Keyboard shortcuts

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