65,187
社区成员




void sortlist()
{
node * newhead, * s, * pre ,* p;
p=head->next;
newhead=p->next;
p->next=NULL;//这里p为什么一定要为空?
while(newhead)
{
s=newhead;
newhead=newhead->next;
pre=head;
p=head->next;
while(p!=NULL && p->a < s->a)
{
pre=p;
p=p->next;
}
s->next=p;
pre->next=s;
}
}