-
Notifications
You must be signed in to change notification settings - Fork 1
/
Lab_10.cpp
50 lines (28 loc) · 927 Bytes
/
Lab_10.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#include <iostream>
#include <vector>
#include <algorithm>
#include <iterator>
using namespace std;
template<typename C>
void printContainer(const string comment, C const& container)
{
cout << comment << " = { ";
for(auto n: container)
{
cout << n << ",";
}
cout << "}; \n";
}
int main()
{
cout << "Create vector vNumbers " << endl;
vector<int> vNumbers {5, 7, 4, 2, 8, 6, 1, 9, 0, 3};
printContainer("vNumbers",vNumbers);
cout << "1- Check if vNumbers is sorted using algorithm is_sorted()" << endl;
cout << "2- Sort vNumbers using algorithm sort()" << endl;
cout << "3- Create a new vector vNumbers2 with unsorted elements" << endl;
cout << "4- Sort vNumbers2" << endl;
cout << "5- Merge vNumbers and vNumbers2 using algorithm merge()" << endl;
cout << "5- Remove all duplicates in destination vector" << endl;
return 0;
}