Answers for "what is sorted array in c++"

C++
3

how to check array is sorted or not in c++

bool check_sorted(int a[],int n)
{
 	return is_sorted(a,a+n); //stl function 
}
Posted by: Guest on February-19-2021
0

how to sort array in c++

#include <algorithm>

int main(){
  int v[2000];
  std::sort(std::begin(v), std::end(v));
}
Posted by: Guest on October-15-2021

Browse Popular Code Answers by Language