June 2017
Intermediate to advanced
532 pages
12h 59m
English
In this section, we are going to play with std::sort and std::partial_sort:
#include <iostream> #include <algorithm> #include <vector> #include <iterator> #include <random> using namespace std;
static void print(const vector<int> &v) { copy(begin(v), end(v), ostream_iterator<int>{cout, ", "}); cout << '\n'; }
int main() { vector<int> v {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
Read now
Unlock full access