@datastructures/stack
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

@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.

Package Sidebar

Install

npm i @datastructures/stack

Weekly Downloads

0

Version

0.0.1

License

MIT

Unpacked Size

6.3 kB

Total Files

9

Last publish

Collaborators

  • yowainwright