You are viewing a single comment's thread. Return to all comments →
@pvamsii43 what is the difference if you write the last else condition as given below?
Node temp = headB; temp.next = headA; headA = temp; headB = headB.next; headA.next = mergeLists(headA.next, headB);
I tried this code and it gave a non terminating output.
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 →
@pvamsii43 what is the difference if you write the last else condition as given below?
I tried this code and it gave a non terminating output.