Node* RemoveDuplicates(Node *head)
{
Node *c=head;
if(head == NULL || head
->next == NULL)
return head;
while(c->next != NULL)
{
if(c->data ==
c->next->data)
{
c->next =
c->next->next;
}
else
c=c->next;
}
return head;
}
No comments:
Post a Comment