list* reverse(list* list){
plist head = list;
if (head)
{
plist next = list->next;
head->next = NULL;
while(next){
plist temp = next->next;
next->next = head;
head = next;
next = temp;
}
}
return head;
}
网友评论