queues

package
v0.12.6 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package queues offers various utilities for handling and manipulating queues data structures.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dequeue

func Dequeue[T any](q *Queue[T]) *T

Dequeue removes a value from the front of a queue.

func Enqueue

func Enqueue[T any](q *Queue[T], value *T)

Enqueue adds a value to the end of a queue.

func Peek

func Peek[T any](q *Queue[T]) *T

Peek returns the first element of the queue without removing it.

func Size

func Size[T any](q *Queue[T]) int

Size returns the number of elements in the queue.

Types

type Queue

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

Jump to

Keyboard shortcuts

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