You are viewing a single comment's thread. Return to all comments →
bool compare_lists(SinglyLinkedListNode* head1, SinglyLinkedListNode* head2) { while(head1 && head2 && head1->data == head2->data){ head1 = head1->next; head2 = head2->next; } if(head1 || head2){ return false; } return true; }
Seems like cookies are disabled on this browser, please enable them to open this website
Compare two linked lists
You are viewing a single comment's thread. Return to all comments →