reverse function for vector in c++ code example
Example 1: std::reverse
std::vector<int> v{1,2,3};
std::reverse(std::begin(v), std::end(v));
Example 2: reverse a vector
vector<int> a = {1,2,3,4,5,6};
reverse(a.begin(), a.end());
std::vector<int> v{1,2,3};
std::reverse(std::begin(v), std::end(v));
vector<int> a = {1,2,3,4,5,6};
reverse(a.begin(), a.end());