add insertion sort

This commit is contained in:
2025-03-10 11:01:57 +03:00
parent 064a2db2ee
commit 7eb6d14dfa
3 changed files with 42 additions and 8 deletions

View File

@@ -1,19 +1,27 @@
#include <hack/logger/logger.hpp>
#include "base/insertion_sort.hpp"
#include "numbers/gcd.hpp"
#include "numbers/prime_factors.hpp"
auto main() -> int
{
hack::log()(algorithms::gcd(4851, 3003));
hack::log()(algorithms::gcd(64, 28));
hack::log()(algorithms::prime_factors_v1(127));
hack::log()(algorithms::prime_factors_v1(128));
hack::log()(algorithms::prime_factors_v1(130));
// std::vector<int> v { 2, 5, 4, 6, 1, 3 };
std::vector<int> v { 5, 4, 1, 5, 6 };
algorithms::insertion_sort(v);
hack::log()(v);
hack::log()(algorithms::prime_factors_v2(127));
hack::log()(algorithms::prime_factors_v2(128));
hack::log()(algorithms::prime_factors_v2(130));
// hack::log()(algorithms::gcd(4851, 3003));
// hack::log()(algorithms::gcd(64, 28));
//
// hack::log()(algorithms::prime_factors_v1(127));
// hack::log()(algorithms::prime_factors_v1(128));
// hack::log()(algorithms::prime_factors_v1(130));
//
// hack::log()(algorithms::prime_factors_v2(127));
// hack::log()(algorithms::prime_factors_v2(128));
// hack::log()(algorithms::prime_factors_v2(130));
}