You are viewing a single comment's thread. Return to all comments →
the C code 😎😁
bool compare_lists(SinglyLinkedListNode* head1, SinglyLinkedListNode* head2) { SinglyLinkedListNode* current=head1; SinglyLinkedListNode* curr=head2; int x=0,s=0; while(current!=NULL) { if(curr==NULL) { s++; break; } if(current->data!=curr->data)x++; current=current->next; curr=curr->next; } if(abs(x-s)==0)return 1; else return 0; }
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 →
the C code 😎😁