1.0.3 • Published 2 years ago

@m3rashid/dsa-js v1.0.3

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

@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

1.0.2

2 years ago

1.0.1

2 years ago

1.0.3

2 years ago

1.0.0

2 years ago