Common algorithms implemented in JavaScript with Mocha/Chai testing.
- Selection Sort
- Bubble Sort
- Linear Search
- Merge Sort
- Quick Sort
- Binary Search
- Insertion Sort
- Bucket Sort
- Shell Sort
- Counting Sort
- Gnome Sort
- Durstenfeld Shuffle (a.k.a. Knuth Shuffle)
- Brute Force String Match
- Longest Common Substring
- Longest Common Subsequence
- Levenshtein Distance
- Damerau-Levenshtein Distance
- Sørensen-Dice Coefficient
- Knuth-Morris-Pratt String Match
- Rabin-Karp String Match
- Boyer-Moore String Match
- Boyer-Moore-Horspool String Match
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.