My code is not giving me correct ans. please take a look
Check now ->
please consider this code and tell me the mistake
Check now ->
i am not able to get the correct ans. after changing the mistake
Initialise i & k with l not 0, and then see the magic.
why is this happening l is also the starting address of the array and starting address of array is 0
No, not everytime l will be equal to 0, do what, add a cout statement in merge function in which you can see value of l & r respectively. It will be more clear to you that how divide & conquer works.
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.