queue

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package queue provides an implementation of the queue data structure in Go.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Queue

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

Queue is an implementation of queue.

func New

func New[T any]() *Queue[T]

New creates a new queue.

func (*Queue[T]) Back

func (s *Queue[T]) Back() T

Back returns the value at the back of the queue.

func (*Queue[T]) Empty

func (s *Queue[T]) Empty() bool

Empty returns whether the queue is empty or not.

func (*Queue[T]) Front

func (s *Queue[T]) Front() T

Front returns the value at the front of the queue.

func (Queue[T]) Len

func (s Queue[T]) Len() int

Size returns the size of the queue.

func (*Queue[T]) Pop

func (s *Queue[T]) Pop() T

Pop pops a value from the queue.

func (*Queue[T]) Push

func (s *Queue[T]) Push(value T)

Push pushes a value into the queue.

Jump to

Keyboard shortcuts

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