void insert(struct node *H,int p)
{
struct node *pr=H;
struct node node;
node=(struct node)malloc(sizeof(struct node));
while(pr->next ->x<p)
{
pr=pr->next;
}
node->next =pr->next ;
node->x =p;
pr->next =node;
}
void insert(struct node *H,int p)
{
struct node *pr=H;
struct node node;
node=(struct node)malloc(sizeof(struct node));
while(pr->next ->x<p)
{
pr=pr->next;
}
node->next =pr->next ;
node->x =p;
pr->next =node;
}
void insert(struct node *H,int p)
{
struct node *pr=H->next,*pn=H;
struct node *node;
node=(struct node*)malloc(sizeof(struct node));
while(pr!=NULL && pr->x<p) //添加链表结束条件
{
pn=pr;//保存前一个节点
pr=pr->next;
}
node->next =pr;
node->x =p;
pn->next =node;
}