This is an educational project containing implementations of some core computer science algorithms.
The project is written in C++. Its goal is to showcase several things:
- Clean well-documented C++ code
- Usage of different build systems (MSBuild, CMake, GNU Make)
- Unit testing via Catch2 framework
- Automated testing via GitHub Actions
The list of implemented algorithms.
- Simple sorting algorithms (simple_sorts.h)
- selection sort
- insertion sort
- bubble sort
- Merge sort (merge_sort.h)
- Quick sort (quick_sort.h)
- Trial division (prime.h)
On Linux install GNU Make and CMake build systems (example below is given for APT package manager which is used by default in Debian based Linux, e.g. Ubuntu and Linux Mint):
sudo apt-get -y install make
sudo apt-get -y install cmakeOn Windows install CMake build system using Chocolatey package manager:
choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System'
...or download CMake installer for Windows
Clone the repository:
git clone https://github.com/dvsav/computer-science.git
cd computer-scienceCompile the sources using one of convenience scripts that call either GNU Make:
./make.sh testIf the build is successful, you'll find the binary files in build/GNUMake/bin directory.
...or CMake:
./cmake.shIf the build is successful, you'll find a binary executable computer-science in build/CMake/gnumake directory.
You can include the source code of this project into your own project, e.g. add this git repository as a git submodule:
cd your_repository
git submodule add https://github.com/dvsav/computer-science.git
Contributions are welcome! Please follow these steps:
Fork the repository.
Create a new branch (git checkout -b feature/YourFeature).
Commit your changes (git commit -m 'Add some feature').
Push to the branch (git push origin feature/YourFeature).
Open a pull request.
This project is licensed under the MIT License.