here why we take node* merge without node* we can’t do ?
Regarding merge sort
why we are using node pointer here instead writing funtions like int ,or else
the function is taking head pointer of the two lists as its input thats why we have written node * in the function arguments.
and becuase the function is returning the head of merged list which is itself a pointer we have mentioned node * as its return type
and if we write the code with int as return type then send me the code how it would be
we cannot return int .becuase merge function is suppose to return head of the newly created list right?
and becuase head is pointer itself we need to use node * as its return type for any cases
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.