[![npm version][npm-image]][npm-url] [![Build Status][circleci-image]][circleci-url] [![dependency status][dm-image]][dm-url] [![devDependency status][devdep-image]][devdep-url] [![npm](https://img.shields.io/npm/l/queue-fifo.svg?style=flat-square)]() # Queue Data Structure ## Description This is a javascript implementation of a [queue](http://en.wikipedia.org/wiki/Queue%28abstract_data_type%29) data structure. A queue data structure models the notion of 'First in First Out', or FIFO— image the line at the grocery store. The first item to be removed from a queue is the first item placed in the queue. Basically, the order in which items are placed in the queue matters. This particular implementation utilizes a [linked list](https://www.npmjs.com/package/dbly-linked-list) as the underlying data structure. This offers several benefits. * We can leverage the work that has already been done to implement the linked list. * This lends itself to a level of composition and abstraction which greatly simplifies this implementation. It provides a wrapper around only those methods of the linked list that we need to construct the properties of a queue data structure. * The 'queue' or 'dequeue' operations can be completed in O(1) time. * No additional overhead is required to 'resize' the data structure to add more elements to the queue. When elements are 'queued' up in the queue, the underlying linked list will adjust its size dynamically. *For specific examples and documentation, see the below sections* ### Motivation: The main purpose of this project is revisit the basics, and focus on the development process. *I wholehearedly acknowledge that the basic data structure space is populated with well-written code and efficient implementations, and one could easily grab one of those libraries and integrate it in their project. However, the main difference between those libraries/implementations and this one is that this is the best implementation I have ever written. My hope is that someone else will find this useful, but understand, this code is not the goal; this will simply be a useful bi-product of the journey. The underlying motivation is to understand and, more importantly, learn from the process to get to the desired end-state—for me it is all about the joy of the journey.* #### Environment: Although this implementation is designed to be used with [Node.js](http://www.nodejs.org), it could be used in other contexts with minor modifications. This implementation does not have any external dependencies that would preclude it from being used in the browser--just include it with a `