PHP 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
composer install
to install the dependencies. If you don't have Composer yet, you can get it here. - Run
bin/phpspec run
to run the tests. - All tests are in the
spec
directory and solutions are located insrc
. - 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.