This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef __GENERATOR_HPP_INCLUDED__ | |
#define __GENERATOR_HPP_INCLUDED__ | |
#include <random> | |
#include <algorithm> | |
namespace util | |
{ | |
class generator final | |
{ |