#include #include #include #include #include "dummy_lib.hpp" std::vector generate_random_numbers(int n, int min, int max) { std::srand(std::time(nullptr)); std::vector v(n); for (int i = 0; i < n; ++i) v[i] = min + std::rand() / ((RAND_MAX + 1u)/max); return v; } int main(int /*argc*/, char* /*argv*/[]) { std::vector v = generate_random_numbers(10000, 0, 1000); // How many times does the smallest element occursts in the vector? int r1 = performance_measuring::count_on_the_way(v); int r2 = performance_measuring::min_element_and_count(v); int r3 = performance_measuring::sort_and_upper_bound(v); assert(r1 == r2); assert(r2 == r3); return EXIT_SUCCESS; }