Queue

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// linked_queue with no maximum size Implementation
	LINKED int = iota

	// ArrayQueue with no maximum size Implementation
	ARRAY
)

Variables

View Source
var (
	QueueHead string = "← | "
	QueueSep  string = " | "
)

Functions

This section is empty.

Types

type ErrEmptyQueue

type ErrEmptyQueue struct{}

func (ErrEmptyQueue) Error

func (e ErrEmptyQueue) Error() string

type ErrFullQueue

type ErrFullQueue struct{}

func (ErrFullQueue) Error

func (e ErrFullQueue) Error() string

type Queue

type Queue[T any] struct {
	// contains filtered or unexported fields
}

func NewLimitedQueue

func NewLimitedQueue[T any](implementation, capacity int, values ...T) Queue[T]

func NewQueue

func NewQueue[T any](implementation int, values ...T) Queue[T]

func (*Queue[T]) Clear

func (queue *Queue[T]) Clear()

func (*Queue[T]) Dequeue

func (queue *Queue[T]) Dequeue() T

func (*Queue[T]) Enqueue

func (queue *Queue[T]) Enqueue(value T)

func (Queue[T]) IsEmpty

func (queue Queue[T]) IsEmpty() bool

func (Queue[T]) IsFull

func (queue Queue[T]) IsFull() bool

func (Queue[T]) Peek

func (queue Queue[T]) Peek() T

func (Queue[T]) Size

func (queue Queue[T]) Size() int

func (*Queue[T]) String

func (queue *Queue[T]) String() string

func (*Queue[T]) ToSlice

func (queue *Queue[T]) ToSlice() []T

Jump to

Keyboard shortcuts

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