Answers for "Sort array using inbuilt sort function in decreasing order"

C++
1

Sort array using inbuilt sort function in decreasing order

// Sort(In Ascending Order) Array using Inbuilt Sort function
sort(arr, arr+n);
  
// Sort(In Ascending Order) Vector using Inbuilt Sort function
sort(arr.begin(), arr.end());

// Sort(In Descending Order) Array using Inbuilt Sort function
sort(arr, arr+n, greater<int>())
  
// Sort(In Descending Order) Vector using Inbuilt Sort function
sort(arr.begin(), arr.end(), greater<int>())
Posted by: Guest on October-12-2021

Code answers related to "Sort array using inbuilt sort function in decreasing order"

Browse Popular Code Answers by Language