#include <bits/stdc++.h> // Vector
#include <algorithm> // Reverse
using namespace std;
int main()
{
vector<int> nums{4,1,2,1,2};
reverse(nums.begin(), nums.end());
return 0;
}
// C++ program to reverse Vector
// using reverse() in STL
#include <bits/stdc++.h>
using namespace std;
int main()
{
// Get the vector
vector<int> a = { 1, 45, 54, 71, 76, 12 };
// Print the vector
cout << "Vector: ";
for (int i = 0; i < a.size(); i++)
cout << a[i] << " ";
cout << endl;
// Reverse the vector
reverse(a.begin(), a.end());
// Print the reversed vector
cout << "Reversed Vector: ";
for (int i = 0; i < a.size(); i++)
cout << a[i] << " ";
cout << endl;
return 0;
}
//vector<int> A;
reverse(A.begin(),A.end());
//Reverse vector partially (from index x to index y)
reverse(v.begin()+x, v.begin()+y+1);
#include <vector>
#include <algorithm>
int main() {
std::vector<int> a;
std::reverse(a.begin(), a.end());
return 0;
}
reverse(start_index, last_index);