JavaScript Algorithms
==========
A collection of common algorithms for practice or review
The best way to use these examples is to read through the tests to understand what's expected of each solution. Then read through the solution until you understand it. Better yet, comment out or remove the solution and try to get the tests passing yourself.
Follow these steps to get started:
- Clone this repo
- Run
npm install
to install the dependencies. You'll need Node/NPM of course. They can both be found here. - Run
npm run gulp
to lint code and run the tests. Alternatively,npm run lint
ornpm run test
will run each of these tasks separately. - All tests are in the
spec
directory and solutions are located inlib
. - Once you understand whats going on, remove the solution code and try to get it working again on your own.
- Go forth and conquer!
I've written these in a few different languages to fully understand how to different languages handle logic problems. Check out the others!
Being a self-taught developer, I built these problems for myself to learn and practice. I've posted them so others can benefit from the same practice. Also, if I've gotten anything wrong, I'm sure someone will let me know and then I'll get to learn again!
You can use these to prepare for interviews, bootcamp prep or just for fun.
Just remember:
- Read through the example.
- Understand what each line of code is doing.
- Try it yourself and get the tests passing.
- Repeat!
Here are some other resources useful for learning this kind of stuff.
If you have trouble running the tests, want to add a new problem or correct something that's not quite right, please open an issue or submit a pull request.