反转链表

来源:互联网 发布:网络云盘哪个最好用 编辑:程序博客网 时间:2024/05/22 15:29

Node * resverselinkWeibo(Node *head)
{
 Node *newhead=NULL;
 Node *next;

 while(NULL!=head)
 {
  next=head->next;
  head->next=newhead;
  newhead=head;
  head=next ;
 }

 return newhead;
}

0 0
原创粉丝点击