You are viewing a single comment's thread. Return to all comments →
I don't get whats wrong, the first test case always fails.
bool compare_lists(SinglyLinkedListNode* head1, SinglyLinkedListNode* head2) { while(head1->next!=NULL && head2->next!=NULL) { if(head1->data!=head2->data) { return 0; break; } head1=head1->next; head2=head2->next; } return 1; }
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 →
I don't get whats wrong, the first test case always fails.