0.0.1 • Published 3 years ago

@datastructures/stack v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

@datastructures/stack 🥞

Typed with TypeScript npm version

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 -D

Usage

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 pancaka

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 queue print() 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.