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