queue

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2026 License: MIT, Apache-2.0 Imports: 1 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[T any] interface {
	// Return the current list length.
	Len() int
	// Return the current list capacity.
	Capacity() int
	// Return the current list head.
	Front() (T, bool)
	// Return the current list tail.
	Tail() (T, bool)
	// Enqueue.
	Enqueue(value T) bool
	// Dequeue.
	Dequeue() T
}

type Queue

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

Queue is a queue backed by container/list

func New

func New() *Queue

New creates a new instance.

func (*Queue) Dequeue

func (q *Queue) Dequeue() any

Dequeue removes or resets state.

func (*Queue) Enqueue

func (q *Queue) Enqueue(item any)

Enqueue updates or inserts a value.

func (*Queue) Len

func (q *Queue) Len() int

Len returns the number of elements.

func (*Queue) Peek

func (q *Queue) Peek() any

Peek returns the result.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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