首页 > 代码库 > 单链表倒序

单链表倒序

 1 mylist *listReverse(mylist *head) 2 { 3     mylist *p=head; 4     mylist *pfront=NULL,*pNext; 5     while(p!=NULL) 6     { 7         pNext=p->next; 8         p->next=pfront; 9         pfront=p;10         p=pNext;11     }12     return pfront;13 }

 

单链表倒序