when in mergesort function when we recursively divide it till the single element left but according to condition given s<=e we return then how merge will be called. plz explain
About merge sort
hello @avverma11057
here is the complete flow of program ->
follow the numbers written in green for order of function calls
sir i am asking when we condition s<=e then accoring to code we have returned it but it takes us to out of the loop but then how we will be able to call merge function
the condition to return is s>=e .
this condition represent a single element in our array . and we dont need to do anything on single element becuase it is already sorted that why no merge will be called for condition s>=e
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.