You are viewing a single comment's thread. Return to all comments →
SinglyLinkedListNode* removeDuplicates(SinglyLinkedListNode* llist) { SinglyLinkedListNode *current = llist, *prev = NULL ; while(current->next != 0){ prev = current; current = current->next; if(prev->data == current->data){ prev->next = current->next; current = prev; } } 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 →