link-list
High performance FIFO queue, O(1) time to push, shift, remove.
Install
npm install link-list
Example
var assert = var LinkList = var list = list list list list // => 2, 3 // Usage of LinkList.remove list var obj = list list LinkList list // => 1, 3
API
new LinkList()
Create a LinkList instance.
Example:
var list =
.push( data )
Push data to the tail of queue, it will return a cancellable (reference of data), which could be removed in O(1) time with remove
method.
Example:
var list = var ref = listlist // remove data in constant time
.shift()
Shift data from the head of queue.
Example:
var list = listlistlistlist // => 1list // => 2list // => 3
.isEmpty()
Check if list is empty.
Example:
var list = list // => true
.remove( ref )
Remove data from queue in constant time.
Example:
var list = var ref = listlistlist // => true