stack

package
v2.1.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2019 License: LGPL-3.0 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 struct {
	// contains filtered or unexported fields
}

Stack is a basic LIFO stack that resizes as needed.

func NewStack

func NewStack(size int) *Stack

NewStack returns a new stack. if stack is full, entries in stack will be kicked out using FIFO

func (*Stack) Len

func (s *Stack) Len() int

Len return size of stack

func (*Stack) Pop

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

Pop removes and returns a node from the stack in last to first order.

func (*Stack) Push

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

Push adds a node to the stack.

Jump to

Keyboard shortcuts

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