Skip to content

Instantly share code, notes, and snippets.

View MyLibh's full-sized avatar
🏠
Working from home

Aleksei MyLibh

🏠
Working from home
View GitHub Profile
@MyLibh
MyLibh / About.txt
Last active May 29, 2018 22:33
BubbleSort
Complexity = O(n^2)
Worst Case:
The number of comparisons in the body of the cycle is (N - 1) * N / 2.
The number of comparisons in the headers of cycles is (N - 1) * N / 2.
The total number of comparisons is (N - 1) * N.
The number of assignments in the cycle headers is (N - 1) * N / 2.
The number of exchanges is (N - 1) * N / 2.
Best case:
@MyLibh
MyLibh / generator.hpp
Last active September 22, 2020 20:49
Simple random generator
#ifndef __GENERATOR_HPP_INCLUDED__
#define __GENERATOR_HPP_INCLUDED__
#include <random>
#include <algorithm>
namespace util
{
class generator final
{