You are viewing a single comment's thread. Return to all comments →
Would these two work in place of the first 3 if-statement above?
if ((headA==NULL) return headB; if ((headB==NULL) return headA;
The idea is that even if both are NULL, it will just return the other which is NULL.
Am I missing something in my though ?
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 →
Would these two work in place of the first 3 if-statement above?
if ((headA==NULL) return headB; if ((headB==NULL) return headA;
The idea is that even if both are NULL, it will just return the other which is NULL.
Am I missing something in my though ?