bool ArraySorted(int* arr, int n)
{
if(n==1)
{
return true;
}
if(arr[n-1]<arr[n] && ArraySorted(arr,n-1))
{
return true;
}
else
{
return false;
}
}
Can tell me where is the error in function
bool ArraySorted(int* arr, int n)
{
if(n==1)
{
return true;
}
if(arr[n-1]<arr[n] && ArraySorted(arr,n-1))
{
return true;
}
else
{
return false;
}
}
Can tell me where is the error in function