Time Complexity of a Function

Here is the code to check if array is sorted or not:- Please confirm whether the time complexity will be O(n) where n is the number of elements of the array or the array size. If not please tell what is the correct answer with explanation.

Time complexity will be O(N) only, that is we are iterating over n elements in an array.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.