queue

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2021 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Packaage queue contains a basic queue of ints.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type T

type T struct {
	D []int
	// contains filtered or unexported fields
}

T represets a queue (FIFO) of ints.

func New

func New(capHint int) *T

New creates a new queue with a capacity hint which can be used to reduce re-allocations and copying.

func (*T) Len

func (q *T) Len() int

Len returns the length of the queue.

func (*T) Pop

func (q *T) Pop() int

Pop pops the first pushed element which has not yet been popped. Pop panics if the queue is empty.

func (*T) Push

func (q *T) Push(v int)

Push pushes v onto the end of the queue.

Jump to

Keyboard shortcuts

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