MERGSORT UNSORTED LINKED LIST

my output add zero I dont understand why?

and how can I take n input what changes need to be made?

Your linked list is formed such that only!


check out this!

now it is outputing -1 with it.


see this

can you explain me what I was my mistake. Why it was giving such error.

just dry run! earlier you first started making linkedlist without any input hence you were getting 0 at start, later -1 was recognised by loop after the node with -1 was formed!

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.