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
- Host: GitHub
- URL: https://github.com/1999/homework-queue
- Owner: 1999
- License: mit
- Created: 2016-07-22T11:08:16.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-08-26T07:45:33.000Z (over 7 years ago)
- Last Synced: 2025-02-17T03:44:13.989Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 16.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
[](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()
```