This is a series of exercises to help me improve my understanding of programming languages, styles, and algorithms. It may also be useful to others for learning or for reference.
Each algorithm has a very simple test case that matches the basic diagrams shown below. To run a test, see the head of the test file for instructions on how to execute it.
If you'd like some help setting up a basic environment to run the test in, you can download a Vagrant VM from my Vagrantfiles repository.
cd erlang
curl -O https://raw.githubusercontent.com/adlawson/vagrantfiles/master/erlang/Vagrantfile
vagrant up && vagrant ssh
cd /srv
erlc bfs.erl
escript bfs_test.erl
Elixir | Erlang | Golang | JavaScript | Julia | Lua | Python |
---|---|---|---|---|---|---|
bfs.ex | bfs.erl | bfs.go | bfs.js | bfs.jl | bfs.lua | bfs.py |
dfs.ex | dfs.erl | dfs.go | dfs.js | dfs.jl | dfs.lua | dfs.py |
The MIT License (MIT)
Copyright (c) 2014 Andrew Lawson <http://adlawson.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.