You are viewing a single comment's thread. Return to all comments →
The C code 😎😁
SinglyLinkedListNode* removeDuplicates(SinglyLinkedListNode* llist) { if(llist==NULL || llist->next==NULL)return llist; SinglyLinkedListNode* q1=llist; SinglyLinkedListNode* q2; // q1=llist; q2=q1->next; while(q2!=NULL) { if(q1->data==q2->data) { q1->next=q2->next; free(q2); q2=q1->next; } else{ q1=q1->next; q2=q2->next; } } return llist; }
Seems like cookies are disabled on this browser, please enable them to open this website
Delete duplicate-value nodes from a sorted linked list
You are viewing a single comment's thread. Return to all comments →
The C code 😎😁