@m3rashid/dsa-js
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

@m3rashid/dsa-js

A no dependency data-structures and algorithms library for node and browser.

checkout on NPM


Requirements

nodejs >=16.x

Install

npm install @m3rashid/dsa-js
# or
yarn add @m3rashid/dsa-js
# or
pnpm add @m3rashid/dsa-js

Usage

// stacks

import { Stack } from '@m3rashid/dsa-js';

const myStack = new Stack<number>();
myStack.push(1);
myStack.push(2);

myStack.pop();
console.log(myStack.top());
console.log(myStack.size());

// queues
import { Queue } from '@m3rashid/dsa-js';

const myQueue = new Queue<number>();
myQueue.enqueue(1);
myQueue.enqueue(3);
myQueue.dequeue();
console.log(myQueue.front());
console.log(myQueue.rear());
console.log(myQueue.print());

// similarly for linked-list, doubly-linked-list etc ...

For more information about the library, Read docs


Inspiration

The inspiration for this library comes from the standard C++ library which includes almost all the daily used data-structures and algorithms.

Currently, this package has implemented stack, queue, linked-list, doubly-linked-list, queue, data structures

Please wait or contribute to the repository to get more


Package Sidebar

Install

npm i @m3rashid/dsa-js

Weekly Downloads

2

Version

1.0.3

License

MIT

Unpacked Size

20.6 kB

Total Files

17

Last publish

Collaborators

  • m3rashid