You are viewing a single comment's thread. Return to all comments →
why not change the recursive part to this (java code):
if(headA.data<headB.data){ headA.next = MergeLists(headA.next,headB); return headA; } else{ headB.next = MergeLists(headA,headB.next); return headB; }
Merge two sorted linked lists
You are viewing a single comment's thread. Return to all comments →
why not change the recursive part to this (java code):