how to check if array is sorted in O(1)c++ code example
Example: 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
}
bool check_sorted(int a[],int n)
{
return is_sorted(a,a+n); //stl function
}