stack

package
v0.0.0-...-e90a610 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IStack

type IStack interface {
	Push(interface{})
	Pop() (interface{}, error)

	Top() (interface{}, error)
	Size() int
	IsEmpty() bool
}

IStack defines the stack interface

type Queue

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

Queue implemented using linked list

func (*Queue) Dequeue

func (q *Queue) Dequeue() (o interface{}, err error)

func (*Queue) Enqueue

func (q *Queue) Enqueue(o interface{})

func (*Queue) Front

func (q *Queue) Front() (o interface{}, err error)

func (*Queue) IsEmpty

func (q *Queue) IsEmpty() bool

func (*Queue) Size

func (q *Queue) Size() int

type StackA

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

StackA implemented using array

func (*StackA) IsEmpty

func (s *StackA) IsEmpty() bool

func (*StackA) Pop

func (s *StackA) Pop() (o interface{}, err error)

func (*StackA) Push

func (s *StackA) Push(o interface{})

func (*StackA) Size

func (s *StackA) Size() int

func (*StackA) Top

func (s *StackA) Top() (o interface{}, err error)

type StackL

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

StackL implemented using linked list

func (*StackL) IsEmpty

func (s *StackL) IsEmpty() bool

func (*StackL) Pop

func (s *StackL) Pop() (o interface{}, err error)

func (*StackL) Push

func (s *StackL) Push(o interface{})

func (*StackL) Size

func (s *StackL) Size() int

func (*StackL) Top

func (s *StackL) Top() (o interface{}, err error)

type StackQ

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

StackQ implemented using 2 queues

func (*StackQ) IsEmpty

func (s *StackQ) IsEmpty() bool

func (*StackQ) Pop

func (s *StackQ) Pop() (o interface{}, err error)

func (*StackQ) Push

func (s *StackQ) Push(o interface{})

func (*StackQ) Size

func (s *StackQ) Size() int

func (*StackQ) Top

func (s *StackQ) Top() (o interface{}, err error)

Jump to

Keyboard shortcuts

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