/***********************算法如下****************************************
**将oldlist从头一个一个的断下,然后一个一个按顺序插入新头**
************************************************************************/
struct student *fanzhuan(struct student *head)
{
if(head==NULL||head->next==NULL)
return head;
struct student *newhead =NULL;
struct student *tmp = head;
do{
head = head->next;
if(newhead ==NULL)
{
newhead =tmp;
tmp->next = NULL;
}
else{//头插法
tmp->next=newhead;
newhead=tmp;
}
tmp=head;
}while(head !=NULL);
return newhead;
}