You are viewing a single comment's thread. Return to all comments →
Node* RemoveDuplicates(Node *head) { // This is a "method-only" submission. // You only need to complete this method.
if(head==NULL){ return NULL; } Node *temp=head->next; while(temp!=NULL && head->data==temp->data){ temp=temp->next; } head->next=RemoveDuplicates(temp); return head;
} Strong Text
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 →
Node* RemoveDuplicates(Node *head) { // This is a "method-only" submission. // You only need to complete this method.
} Strong Text