Merge two sorted linked list

node* merge(nodea,nodeb)
why we created pointer type function here
and what it return

Hello @Ankit_123,

This function accepts two pointers of type node i.e.
a: it stores the address of the head of the first linked list, and
b: it stores the address of the head of the second linked list

Now after combining/merging them into one linked list,
the function returns the address of the first node of the merged linked list formed.

So, the return type of this function is a pointer of type node i.e. node *

Hope, this would help.
Give a like, if you are satisfied.

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.