Options
All
  • Public
  • Public/Protected
  • All
Menu

awesome-dsa - v0.0.6

Awesome-DSA


What is Awesome DSA?

Awesome DSA provides classic Data Structures and Algorithms to use in any of your projects
Currently provides,

  • Data Structures
Structure Description
SinglyLinkedList A linked list that has nodes which only has a reference to the next node.
DoublyLinkedList Functionality is the same for the most part (there are two more methods in this class) as SinglyLinkedList for the end users but implemented with nodes that has references to both next and previous node.
Stack A more practical and useful implementation of a stack which grows as needed.
LimitedStack A classic implementation of Stack that is limited to the size it's given at the initialization.
Queue A Queue structure that can grow in size as needed.
LinearQueue Implementation of a linear queue, which is limited in size and can't recover space from dequeued items.
CircularQueue Implementation of a circular queue, which is limited in size but can recover space from dequeued items.
Graph Implementation of a graph with methods for different traversal methods and other useful algorithms.

Awesome DSA is released under the MIT license.You are free to use the source code in anyway you want.Also contributions are much appreciated as I'm just doing this in my free time for fun 😉.

Documentation

Visit the documentation here | Also you editor will give great suggestions because of extensive tsdoc comments.

Installation

Using npm:

npm i awesome-dsa

Using yarn:

yarn add awesome-dsa

Note: add --save if you are using npm < 5.0.0

Usage

This library provides classic text book definitions of data structures such as SinglyLinkedList, LinearQueue & a Stack class that is limited to a specified size(this is called LimitedStack).But it also provides much more practical classes such as a Queue, Stack that is unlimited and provides familiar methods(ex - dequeue,enqueue for Queue and push,pop for Stack).

In nodejs environment:

const dsa = require('awesome-dsa');
const list = new dsa.DoublyLinkedList();
//or
const {SinglyLinkedList} = require('awesome-dsa');
const list = new SinglyLinkedList()
list.insertAtEnd(10)

In ES modules (Typescript or Javascript):

import dsa from 'awesome-dsa'
const q = new dsa.LinearQueue();
//or
import {SinglyLinkedList} from 'awesome-dsa';
const list = new SinglyLinkedList()

Recommended to use {} syntax to leverage tree shaking capabilities of bundling tools.It will reduce you bundle size greatly.

Written By

Nethsara Sandeepa Elvitigala
Twitter | linkedin | Github | Facebook

Generated using TypeDoc, the 1/4/2022 at 10:37:56 PM