std sort algorithm c++ code example
Example 1: sort in descending order c++ stl
sort(arr, arr + n, greater<int>())
Example 2: stl sort in c++
sort(arr, arr+n); // sorts in ascending order
sort(arr, arr + n, greater<int>())
sort(arr, arr+n); // sorts in ascending order