Code not working properly (Recursive check if an array is sorted)
Code not working properly
Hello @anshufirefox
the main problem in your code is that you are trying to access elements by doing arr+1.
in this way you are incrementing 1 in the starting blocks address and this you can chek by priting the array elements it will produce random garbage values.
you to do this with indexing.
Here is the corrected code:
this is the corrected code.
if you have any doubt you can ask here:
Happy Learning!!
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.