queue

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Queue

type Queue[V any] interface {
	// Push adds an element to the queue.
	Push(V)
	// Pop removes and returns the element at the front of the queue.
	Pop() (V, bool)
	// Peek returns the element at the front of the queue without removing it.
	// It returns nil if the queue is empty.
	Peek() (V, bool)
	// Len returns the number of elements in the queue.
	Len() int
}

func New

func New[V any]() Queue[V]

New returns a new queue.

func NewWithSize

func NewWithSize[V any](size int) Queue[V]

NewWithSize returns a new queue with the specified size.

Jump to

Keyboard shortcuts

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