Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

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>())
 
PREVIOUS NEXT
Tagged: #Sort #array #inbuilt #sort #function #decreasing #order
ADD COMMENT
Topic
Name
8+8 =