You are viewing a single comment's thread. Return to all comments →
nice solution.
The latter part of the code can be slightly shortened:
if(headA.data >= headB.data) { Node temp = headB; headB = headB.next; temp.next = headA; headA = temp; } headA.next = mergeLists(headA.next,headB); return headA;
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 →
nice solution.
The latter part of the code can be slightly shortened: