You are viewing a single comment's thread. Return to all comments →
SinglyLinkedListNode* head2) { if(!head1) return head2; if(!head2) return head1; else if(head1->data<=head2->data){ head1->next = mergeLists(head1->next, head2); return head1; } else{ head2->next = mergeLists(head1, head2->next); return head2; } }
Seems like cookies are disabled on this browser, please enable them to open this website
I agree to HackerRank's Terms of Service and Privacy Policy.
Merge two sorted linked lists
You are viewing a single comment's thread. Return to all comments →
C++ simple