An open API service indexing awesome lists of open source software.

https://github.com/1999/homework-queue

Simple implementation of Queue
https://github.com/1999/homework-queue

Last synced: 9 days ago
JSON representation

Simple implementation of Queue

Awesome Lists containing this project

README

        

[![Build Status](https://travis-ci.org/k03mad/homework-queue.svg?branch=master)](https://travis-ci.org/k03mad/homework-queue)

### Simple implementation of Queue.

A queue is a first-in-first-out (FIFO) data structure - items are added to the end of the queue and removed from the front.

### How-to:

```js
const Queue = require('homework-queue');
const myQueue = new Queue();

// add element to queue
myQueue.enqueue(value)
// return true if queue is empty
myQueue.isEmpty()
// return first element of queue
myQueue.peek()
// return first element and delete it from queue
myQueue.dequeue()
```