queue

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 IQueue

type IQueue interface {
	Enqueue(interface{})
	Dequeue() (interface{}, error)

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

IQueue defines the queue interface

type QueueA

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

QueueA implemented using array

func (*QueueA) Dequeue

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

func (*QueueA) Enqueue

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

func (*QueueA) Front

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

func (*QueueA) IsEmpty

func (q *QueueA) IsEmpty() bool

func (*QueueA) Size

func (q *QueueA) Size() int

type QueueL

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

QueueL implemented using linked list

func (*QueueL) Dequeue

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

func (*QueueL) Enqueue

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

func (*QueueL) Front

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

func (*QueueL) IsEmpty

func (q *QueueL) IsEmpty() bool

func (*QueueL) Size

func (q *QueueL) Size() int

type QueueS

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

QueueS implemented using 2 stacks

func (*QueueS) Dequeue

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

func (*QueueS) Enqueue

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

func (*QueueS) Front

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

func (*QueueS) IsEmpty

func (q *QueueS) IsEmpty() bool

func (*QueueS) Size

func (q *QueueS) Size() int

type Stack

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

Stack implemented using linked list

func (*Stack) IsEmpty

func (s *Stack) IsEmpty() bool

func (*Stack) Pop

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

func (*Stack) Push

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

func (*Stack) Size

func (s *Stack) Size() int

func (*Stack) Top

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

Jump to

Keyboard shortcuts

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