stack

package
v0.0.0-...-93f9cd5 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2021 License: MIT, MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Element

type Element struct {
	// contains filtered or unexported fields
}

type Stack

type Stack struct {
	// contains filtered or unexported fields
}

func NewStack

func NewStack(max int) *Stack

func (*Stack) Len

func (s *Stack) Len() int

Return the stack's length

func (*Stack) Max

func (s *Stack) Max() int

Return the stack's max

func (*Stack) Peek

func (s *Stack) Peek() (value interface{}, exists bool)

Peek returns a top without removing it from list

func (*Stack) Pop

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

Remove the top element from the stack and return it's value If the stack is empty, return nil

func (*Stack) PopLast

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

func (*Stack) Push

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

Push a new element onto the stack

Jump to

Keyboard shortcuts

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