请教。。。链表排序~!
![](images/smilies/emot/em06.gif)
stu *insert_num(stu *head)
{
struct stu *head1,*p,*p1,*p2,*t;
head1=NULL;
t=head;
while(t!=NULL)
{
p=t;
p1=head1;
if (head1==NULL) head1=p;
else
{
while((p->num>p1->num)&&(p1->next!=NULL))
{
p2=p1;
p1=p1->next;
}
if(p->num<p1->num)
{
if(head1==p1) head1=p;
else p2->next=p;
p->next=p1;
}
else p1->next=p;
}
t=t->next;
}
return head1;
}