Skip to content

noctera/AlgoCpp

Repository files navigation

AlgoCpp

This is my repository with self implemented algorithms, written in C++.
Currently available algorithms:

└── algorithms
    ├── search
    │   └── linear search
    └── sorting
        └── bubblesort

Example

// 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;
    }
}

Requirements

  • C++17 compatible compiler

Installation via Cmake

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
)

Build the project

Build everything at once

cmake -S all -B build
cmake --build build

# docs need to be generated seperately
cmake --build build/docs --target docs

Build only the examples

cmake -S examples -B build/examples
cmake --build build/examples

Build only the tests

cmake -S tests -B build/tests
cmake --build build/tests

Build only the docs

cmake -S docs -B build/docs
cmake --build build/docs --target docs

Format the code

cmake -S all -B build
cmake --build build --target fix-format

About

C++17 lib with self implemented algorithms

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published