stack

package module
Version: v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2020 License: MIT Imports: 0 Imported by: 0

README

go-stack

Stack implementation based upon interface{} entities

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 struct to keep track of linked list and length

func New

func New() *Stack

New stack - Create a new stack

func (*Stack) Len

func (s *Stack) Len() int

Len returns the number of items in the stack

func (*Stack) Peek

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

Peek is a view the top item on the stack

func (*Stack) Pop

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

Pop the top item of the stack and return it

func (*Stack) Push

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

Push a value onto the top of the stack

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL