Solutions to some of the programming challenges I've written in my free time. The code is relatively fast but unless specified otherwise, is not optimised for speed.
To compile the code, you will need a C and C++ compiler (GCC, G++, Clang etc.) as well as GNU Make. If you choose to use a compiler that isn't GCC or G++, make sure to update the CC and CXX makefile variables.
Once compiled, you can choose to run the program while manually entering input values or you can redirect the program's input to a sample file. Assuming you're using bash, this can be accomplished with
/path/to/program < /path/to/inputWe can also compare a program's output with an expected output using
diff <(/path/to/program < /path/to/input) /path/to/outputwhere the content of the output file must match the expected output if the program were to be run with the given input file.
The folders provided with this software are structured in the following manner
- samples sample input and output files used to test code behavior.
- src contains the source code tree.