c++ use which sort 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()); // sorts in descending order
sort(arr, arr+n); // sorts in ascending order
sort(arr, arr+n, greater()); // sorts in descending order