This is my repository with self implemented algorithms, written in C++.
Currently available algorithms:
└── algorithms
├── search
│ └── linear search
└── sorting
└── bubblesort
// single header include
#include <AlgoCpp/algorithms.hpp>
#include <iostream>
int main() {
std::vector<int> foo{1, 4, 5, 2, 3};
// check if int is in vector with lenear search
if (algocpp::search::linearSearch(foo, 2)) {
std::cout << "found" << std::endl;
}
}
- C++17 compatible compiler
cmake_minimum_required(VERSION 3.18 FATAL_ERROR)
project(<your_project_name>)
include(FetchContent)
FetchContent_Declare(
AlgoCpp
GIT_REPOSITORY https://github.com/noctera/AlgoCpp.git
GIT_TAG origin/main
)
FetchContent_MakeAvailable(AlgoCpp)
target_link_libraries(
<your_target_name>
PUBLIC AlgoCpp
)
cmake -S all -B build
cmake --build build
# docs need to be generated seperately
cmake --build build/docs --target docs
cmake -S examples -B build/examples
cmake --build build/examples
cmake -S tests -B build/tests
cmake --build build/tests
cmake -S docs -B build/docs
cmake --build build/docs --target docs
cmake -S all -B build
cmake --build build --target fix-format