Median of sorted array


in this code whenever I’m removing all the cout statements its giving an segmentation fault

I am not able to understand your approach, post question so I can help you.

there are two sorted array I merged it to one sorted array

But its giving a segfault whenever I comment out the couts(which I dont want in the code) like in https://ide.codingblocks.com/s/308973
but no segfault in this https://ide.codingblocks.com/s/308702
WHYY??

apply merge sort correctly,

you can see merge sort code here.

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.

ok but whats causing an error in https://ide.codingblocks.com/s/308973

I think it’s only because of your merge sort tree application. What you are doing is complex as well as difficult to debug. So always try to apply algorithms using simple method.