queue

package
v0.2.12 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2021 License: MIT Imports: 1 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[T any] struct {
	// contains filtered or unexported fields
}

Queue is a container adapter that gives the programmer the functionality of a queue - specifically, a FIFO (first-in, first-out) data structure.

func (*Queue[T]) Back

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

Back returns value of the last element in Queue Complexity O(1)

func (*Queue[T]) Empty

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

Empty checks if Queue has no element Complexity O(1)

func (*Queue[T]) Front

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

Front returns value of the first element in Queue Complexity O(1)

func (*Queue[T]) Pop

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

Pop removes and returns first element of Queue Complexity O(1)

func (*Queue[T]) Push

func (q *Queue[T]) Push(element T)

Push inserts element at the end of Queue Complexity O(1)

func (*Queue[T]) Size

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

Size returns number of elements in queue Complexity O(1)

Jump to

Keyboard shortcuts

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