0.0.1 • Published 3 years ago
@datastructures/stack v0.0.1
@datastructures/stack 🥞
A minimal functional typed implementation of a stack. 🦄
An ordered structure of data inputs obeying the principle of last in, first out.
Install
yarn add @datastructures/stack -DUsage
import { stack } from '@datastructures/stack'
const pancake = stack()
pancake.add('one pancaka')
pancake.add('two pancaka')
// I'm so hungry
pancake.remove() // yum, pancaka remove
pancake.print() // one pancakaAPI
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.
View other data structures.
0.0.1
3 years ago