NODE *DupRem(NODE *head)
{
NODE *p1 = head, *p2, *resultList = NULL, *temp = NULL;
while(p1 != NULL)
{
p2 = p1->link;
while(p2 != NULL)
{
if(p1->data == p2->data)
{
break;
}
else
{
p2 = p2->link;
}
}
if(p1->data==p2->data)
{
p1 = p1->link;
}else
{
if(resultList == NULL)
{
resultList = p1;
temp = p1;
p1 = p1->link;
}else
{
temp->link = p1;
temp = temp->link;
p1 = p1->link;
}
}
}
return resultList;
}
Categories
FollowersBlog Archive
Jobs
Find more freelance jobs
|
Saturday, February 2, 2008
Subscribe to:
Post Comments (Atom)
|
Popular Posts
|
No comments:
Post a Comment