dsakit is a JavaScript library offering a wide range of data structures and algorithms for direct use. It includes sorting (Bubble, Merge, Quick), searching (Binary Search), dynamic programming, greedy algorithms, and essential structures like stacks, que
npm install dsakitsh
npm install dsakit
`
Usage
$3
1. Require the dependency
2. Create an object of the required data structure or call the function for algorithms
3. Use the provided methods
$3
`javascript
const dsakit = require("dsakit");
const stack = new dsakit.Stack(); // Data Structure (Class)
stack.push(10);
stack.push(20);
console.log("Popped:", stack.pop());
const sortedArray = dsakit.quickSort([5, 3, 8, 4]); // Algorithm (Function)
console.log("Sorted Array:", sortedArray);
`
Available Modules
| Category (Type) | Classes (Data Structures) / Functions (Algorithms) |
|----------------------|------------------------------------------------|
| Stack (Class) | Stack, DynamicStack |
| Queue (Class) | Queue, PriorityQueue, Deque |
| Linked List (Class) | SinglyLinkedList, DoublyLinkedList, CircularLinkedList |
| Graph (Class & Function) | DirectedGraph (Class), UnDirectedGraph (Class), WeightedGraph (Class), dijkstra (Function) |
| Tree (Class) | BinaryTree, BinarySearchTree, AVL_Tree, B_Tree, N_Ary_Tree, GeneralTree, HeapTree, RedBlackTree, SegmentTree, TrieTree |
| Sorting (Function - In-Place Sorts) | bubbleSort, countingSort, cyclicSort, heapSort, insertionSort, mergeSort, quickSort, radixSort, selectionSort, timSort |
| Searching (Function) | binarySearch, sequentialSearch |
| String Matching (Function) | stringMatching |
| Matrix (Function) | matrixMultiplication, chainMatrixMultiplication |
| Greedy Algorithms (Function) | makingChange |
| Dynamic Programming (Function) | knapsack, floydWarshall |
For more details on each topic, check the respective info.md` file in the repository: DSAKIT Repository.