算法是一个程序的灵魂,就是说是它的思想和指导这个程序应该怎么来实现.

倚天照海花无数,流水高山心自知。

LS的看的蛮仔细.
我刚写了个小程序测试了一下.
#include "stdio.h"
#include "conio.h"
#include"malloc.h"
typedef struct node{
   int data;
   struct node *next;
}node ;
main()
{
    node *head=(node *)malloc(sizeof(node));
    head->next=NULL;
    head->next->data=3;
    printf("Hello, world%d\n",head->next->data);
    getch();
}
#include "stdio.h"
#include "conio.h"
#include"malloc.h"
typedef struct node{
   int data;
   struct node *next;
}node ;
main()
{
    node *r,*head=(node *)malloc(sizeof(node));
    head->next=NULL;
    r=head->next;
    head->next->data=3;
    printf("Hello, world%d  %d\n",head->next->data,r->data);
    getch();
}
总结:我认为.既然已经给r一个指针,它的初始化为空,但不能就判断它就是空指针了.两者是有区别的.不知道我这样解释对不对.
谢谢关注.请大家以后多提意见.

#include"head_node.h"
/**********************************/
/*         删除重复               */
/**********************************/
void Delete_Repeat_Node(node *head)
{
    node *p,*pre,*s;
    pre=head->next;
    p=pre->next;
    while(p)
    {
        s=p->next;
        while(s&&s->info!=p->info)
        {
            s=s->next;
        }
        if(s)
        {
            pre->next=p->next;
            free(p);
            p=pre->next;
        }
        else
        {
            pre=p;
            p=p->next;
        }
    }
}
