@datastructures/queue
v0.0.1
Published
A minimal functional typed implementation of Linked List ➡️|➡️|
Downloads
5
Readme
@datastructures/queue ➡️|➡️|
A minimal functional typed implementation of a queue. 🦄
An ordered structure of data inputs obeying the principle of first in, first out.
Install
yarn add @datastructures/queue -D
Usage
import { queue } from '@datastructures/queue'
const todo = queue()
todo.add('do laundry')
todo.add('wash car')
todo.remove()
todo.print() // => 'wash car'
todo.length() // => 1
API
Methods
add(item)
adds an item to the queue
ex:
queue.add('foo')
remove()
removes the last item from the queue ex:queue.remove()
length()
returns the length of the queueprint()
prints all items in the queue
Data Structures 🦄
Basic. Functional. Typed. Data Structures.
Functional typed data structures offering structure clarity and simplicity.