stack

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArrayStack

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

func NewArrayStack

func NewArrayStack() *ArrayStack

func (*ArrayStack) Len

func (s *ArrayStack) Len() int

func (*ArrayStack) Peek

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

func (*ArrayStack) Pop

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

func (*ArrayStack) Push

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

type LinkedStack

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

func NewLikedStack

func NewLikedStack() *LinkedStack

Create a new stack

func (*LinkedStack) Len

func (this *LinkedStack) Len() int

Return the number of items in the stack

func (*LinkedStack) Peek

func (this *LinkedStack) Peek() interface{}

View the top item on the stack

func (*LinkedStack) Pop

func (this *LinkedStack) Pop() interface{}

Pop the top item of the stack and return it

func (*LinkedStack) Push

func (this *LinkedStack) Push(value interface{})

Push a value onto the top of the stack

func (*LinkedStack) Show

func (this *LinkedStack) Show()

Jump to

Keyboard shortcuts

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