stack

package module
v0.0.0-...-3746073 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

README

stack

standard library container/list to build stack

##install go get github.com/duckbb/stack ##quick start

s := NewStack()

//push
s.Push(1)
s.Push(2)
s.Push(3)
s.Push(4)
s.Push(5)

//pop
v, ok := s.Pop()

//remove 
s.Remove(1)

//exitst
find := s.Exist(2)

//length
length := s.Len()

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 NewStack

func NewStack() *Stack

func (*Stack) Exist

func (s *Stack) Exist(value interface{}) bool

get

func (*Stack) Len

func (s *Stack) Len() int

len

func (*Stack) Pop

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

pop

func (*Stack) Push

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

push

func (*Stack) Remove

func (s *Stack) Remove(value interface{}) bool

rm one element

Jump to

Keyboard shortcuts

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