TechoSagar: How to sort in descending order using STL programming ?

Search

Google Alert - jobs

How to sort in descending order using STL programming ?

To sort an array in increasing order simply write sort(a,a+n).
for sorting in decreasing order use sort(arr, arr+n, greater<int>());

where a is name of array a[] and n is size of array ;

Follow us

Follow Bijendra Kumar on Facebook