bool isArraySorted (int arr[],int size) {
if (size == 0 || size == 1)
return true;
if (arr[0]>arr[1])
return false;
else {
bool remainingPart = isArraySorted(arr+1,size-1);
return remainingPart;
}
}
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter