Common algorithms implemented in JavaScript with Mocha/Chai testing.
- Binary Search
- Bubble Sort
- Bucket Sort
- Cocktail Sort
- Counting Sort
- Durstenfeld Shuffle (a.k.a. Knuth Shuffle)
- Gnome Sort
- Insertion Sort
- Linear Search
- Merge Sort
- Quick Sort
- Radix Sort
- Sattolo Cycle
- Selection Sort
- Shell Sort
- Sleep Sort
- Boyer-Moore String Match
- Boyer-Moore-Horspool String Match
- Brute Force String Match
- Damerau-Levenshtein Distance
- Hamming Distance
- Knuth-Morris-Pratt String Match
- Levenshtein Distance
- Longest Common Subsequence
- Longest Common Substring
- Rabin-Karp String Match
- Sørensen-Dice Coefficient
To run the tests yourself you'll need to download the project and install its node module dependencies via npm. So, if you haven't already installed Node.js and npm for use on your command line hop over to the Node.js website and follow their download and installation instructions. Once you have Node.js and npm installed, clone the project onto your computer using the following command in your terminal/command prompt/console:
git clone https://github.com/sumtype/common-algorithms-js.git
(Just in case you haven't already installed Git, do so by following the installation instructions here, then enter the previous command again once it's installed.) Once you've downloaded the project use the following command to navigate to the project's root directory:
cd common-algorithms-js
Next, install the project's node module dependencies from npm. Do so by entering this command:
npm install
Once all the dependencies are installed you'll be ready to run the tests. Enter the following command to run them:
npm run local-test
This repository uses Travis-CI for deployment testing on Node.js versions 8.9.x and 9.4.x.