/* 删除链表中的重复节点 */
//递归法求解
LinkedList *delSame(LinkedList *head)
{
pLinkedList pointer,temp=head;
if (head->next == NULL) //只有头结点,链表为空
{
return head;
}
head->next = delSame(head->next);
pointer = head->next;
while (pointer != NULL)
{
if (head->iValue == pointer->iValue)
{
temp->next = pointer->next;
free(pointer);
pointer = temp->next;
}
else
{
pointer = pointer->next;
temp = temp->next;
}
}
return head;
}