data_structure_models
v1.0.3
Published
A NPM Package which provides access to various Data Structures in Javascript eliminating the purpose of coding them from scratch.
Downloads
9
Maintainers
Readme
Data-Structures
Introduction
Data Structures is an NPM Package built for Developers to get a High-Level API Access to various Data Structures. This is my first NPM Package and this tool was developed for practising various Data Structures and was later wrapped as a Package and published on NPM.
Installation
The Package can be installed by running the follow command on your Command Prompt/Shell:
$ npm install data_structure_models
After installation of the the Package, you can run the following script to validate if the Package is running fit and fine:
var dataStructureModels = require("data_structure_models");
var datastructures= new dataStructureModels();
var stack=datastructures.Stack();
stack.push(5);
stack.push(3);
stack.print();
This will print the Stack on the Console and you are free to experiment with the wide number of Data Structures available with the Package.
How to use the Package?
This Package has a lot of Data Structures which you can try out. Some of the Data Structures and their particular implementations have been listed below. We are taking the example of Binary Search Tree here. Binary search tree is a data structure that quickly allows us to maintain a sorted list of numbers.
To access Binary Search Trees, try out the following script:
var dataStructureModels = require("data_structure_models");
var datastructures= new dataStructureModels();
var bst=datastructures.BinarySerachTree();
bst.add(5);
bst.add(3);
bst.add(8);
console.log(bst.findMax())
// Output: 8
Besides these, other Data Structures that can be called and access using the package are:
- Hash Table
- Linked List
- Priority Queue
- Queue
- Stack
- Doubly Linked List
- Queue using Linked List