Queue data structure implemented in Node.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
README.md
index.js
package.json
test.js

README.md

queue

Queue data structure implemented in Node.

Usage

var Queue = require('./');

// Instantiate queue object
var queue = new Queue();

queue.enqueue('bird');
queue.enqueue('cat');
queue.enqueue('dog');

queue.dequeue()  // 'bird'
queue.dequeue()  // 'cat'
queue.dequeue()  // 'dog'

API

Queue#enqueue(data)

Enqueues the node at the last of the queue.

Queue#dequeue()

Dequeues the first node of the queue.

Queue#peek()

See the first node of the queue.

See also