queue

package
v0.0.0-...-4def9c8 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2015 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package queue implements a queue.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Q

type Q struct {
	// contains filtered or unexported fields
}

Q is the internal representation of the data structure.

func (*Q) Init

func (q *Q) Init()

Init initializes the queue data structure. A queue must be initialized before it can be used. O(1)

func (*Q) IsEmpty

func (q *Q) IsEmpty() bool

IsEmpty returns true the queue has no elements. O(1)

func (*Q) Len

func (q *Q) Len() int

Len returns the number of elements in the queue. O(1)

func (*Q) Pop

func (q *Q) Pop() interface{}

Pop dequeues an element from the queue. O(1)

func (*Q) Push

func (q *Q) Push(v interface{})

Push enqueues an element to the queue. O(1)

Jump to

Keyboard shortcuts

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