This is a simple C++ console application designed to implement and demonstrate various fundamental algorithms. It serves as a learning tool to understand algorithmic concepts and their performance characteristics.
Go to this page download the catch_amalgamated.cpp and catch_amalgamated.hpp.
Make a directory called "external" inside the project directory:
cd Algorithms
mkdir external
Now copy the downloaded files (catch_amalgamated.cpp and catch_amalgamated.hpp) into the "external" directory inside the project directory.
Clone this repository:
git clone https://github.com/Helland369/Algorithms.git
cd into the project directory:
cd Algorithms
run cmake:
cmake -G Ninja -S . -B build
cd build:
cd build
run ninja inside the build directory:
ninja
run the program:
./algorithms
run the test:
./tests
| Name | Big O notation |
|---|---|
| Bubble sort | O(n²) |
| Merge sort | O(n*log(n)) |
| Quick sort | O(n log n) or O(n^2) |
| Binary search | O(log n) |
| Jump search | O(sqrt n) |
| Knuth-Morris-Pratt | O(n + m) |
| Rabin-Karp | O((n-m+1)m) |
| SHA256 | O1 or On |