Sorted array CPP


plz help to find where am i wrong.

@Kush_1312
I found a number of mistakes in your code.

  1. You cannot create such a big array in the main() ( ~10^5 only in main and ~10^6 in heap).
  2. You were only checking for < and not for <=
  3. I have also added the condition size==0 as well.
    https://ide.codingblocks.com/s/192268

but for size==0 the array wouldn’t exist!?

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.