A comprehensive and lightweight npm package of common data structures and algorithms to accelerate development.
Why is this module named program.js? An inspiration for this project was computer science pioneer Niklaus Wirth: author of the classic textbook Algorithms + Data Structures = Programs. We believe that the philosophy of algorithms and data structures being at the core of software is important, so this module is made in the textbook's honor.
- Bubble Sort
- Insertion Sort
- Selection Sort
- Quick Sort
- Merge Sort
- Factorial
- Fibonacci
- Combinations
- Permutations
- Node
- DoubleNode
- SinglyLinkedList
- DoublyLinkedList
- Stack
- Queue
- Heap
- TreeNode
- Binary Search Tree
- HashTable
- Install the package using
npm install --save programjs
oryarn add programjs
- Import the feature set you would like to use (e.g.
import { algorithms } from 'programjs'
) - Access specific implementation through the feature set object (e.g.
const sorted_array = algorithms.bubble_sort(array)
)
If you're interested in contributing to program.js, refer to our guide.
We believe in open source projects. Our code is licensed under the MIT License..