queue

package
v0.0.0-...-f52cd5e Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2014 License: MIT Imports: 1 Imported by: 0

README

Queue

View the docs

Installation
$ go get github.com/domluna/container/queue
Example

import (
  "github.com/domluna/container/queue"
)

func main() {
  q := queue.New()
  q.Push(1)
  q.Push(2)
  q.Push(3)
  v := t.Pop() // v = 1
  v := t.Pop() // v = 2
  v := t.Pop() // v = 3
  v := t.Pop() // v = nil
}

Documentation

Overview

Package queue implements the Queue(http://en.wikipedia.org/wiki/Queue_(abstract_data_type)) data structure.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Queue

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

Queue is a queue data structure.

func New

func New() *Queue

New creates a new Queue.

func (*Queue) Pop

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

Pop removes the element at the front of the queue.

func (*Queue) Push

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

Push inserts an element into the queue.

Jump to

Keyboard shortcuts

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