You are viewing a single comment's thread. Return to all comments →
I disagree. If both are NULL, then
if (headA == NULL) return headB;
will trigger and return NULL since that is what headB equals to. And we did expect NULL, so the case of two NULLs is indeed redundant.
Seems like cookies are disabled on this browser, please enable them to open this website
Merge two sorted linked lists
You are viewing a single comment's thread. Return to all comments →
I disagree. If both are NULL, then
will trigger and return NULL since that is what headB equals to. And we did expect NULL, so the case of two NULLs is indeed redundant.