dsa_package.js
v1.0.10
Published
An npm package that can help you to use all of the famous ds and algo in your coding implementations
Downloads
37
Readme
A Data Structures and Algorithms library for NodeJS
This package contains templates for the following Data Structures and Algorithms:
- Data Structures
Heap Queue
- Algorithms
Binary Search Bubble Sort Merge Sort Quick Sort
How to use the Algorithms package?
// import the package
const dsa = require("dsa_package.js"); const arr = [7, 3, 1, 5, 8, 9, 0, 2];
// call the inbuilt sort function
dsa.Algorithms.BubbleSort(arr); console.log(arr);
How to use the Data-Structures package?
// import the package
const dsa = require("arijitdsa.js");
// creating an object of the PriorityQueue and inserting the elements using inbuilt function
const pq = new dsa.DataStructures.PriorityQueue((a, b) => a> b); pq.insert(9); pq.insert(8); pq.insert(1); pq.insert(9); pq.insert(5); pq.insert(4);
pq.display();