This file contains 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
void heapsort(std::vector<int>& v) | |
{ | |
std::vector<int> u; | |
for(auto i : v) | |
{ | |
u.push_back(i); | |
std::push_heap(u.begin(), u.end(), std::greater<int>{}); | |
} | |
for(auto& i : v) | |
{ |
This file contains 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
#include <random> | |
#include <cmath> | |
#include <limits> | |
#include <vector> | |
#include <algorithm> | |
#include <iostream> | |
#define N 100 | |
#define N_VALIDATION 100000 | |
#define N_RUNS 1000 |