赞
踩
- struct node* reverse_linklist(struct node*head)
- {
- if(head == NULL || head->next == NULL)
- return head;
-
- struct node* beg = NULL;
- struct node* mid = head;
- struct node* end = head->next;
- while(1)
- {
-
- mid->next = beg;
- if(end == NULL)
- break;
- beg = mid;
- mid = end;
- end = end->next;
-
- }
-
- head = mid;
- return head;
- }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。