Now, we are moving towards the good stuff. This module is all about STL vectors and pairs. Vectors are STL containers that you will most frequently use. Think of them as dynamic arrays. They can be dynamically expanded and shrinked. Here we will learn the library functions to sort and reverse a vector.
You are given a vector V of size n. You need to sort it and reverse it.
The first line of input contains T denoting the number of testcases. T testcases follow. Each testcase contains two lines of input. The first line contains n denoting the size of the array. The second line contains the space seperated elements of the vector.
For each testcase, in a new line, print the required output.
Since this is a function problem, you don't need to take any input. Just complete the provided functions sortVector() and reverseVector().
1 <= T <= 100
1 <= n <= 107
0 <= Vi <= 107
1 2 3 4 5
1 2 3 4 5
5 4 3 2 1
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.