|
Posted on
2008-10-19 04:49
带你去月球
阅读( 332)
评论()
编辑
收藏
举报
![](https://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif) Code
1 link* mid(link* head)
2 {
3 link* p1,*p2;
4 p1=p2=head;
5
6 if(head==NULL || head->next==NULL)
7 return head;
8 do {
9 p1=p1->next;
10 p2=p2->next->next;
11 }while(p2 && p2->next);
12 return p1;
13 }
|