struct listnode* middlenode(struct listnode* head)
{
struct listnode* fast=head;
struct listnode* slow=head;
if(head!=NULL)
{
while(fast!=NULL&&fast->next!=NULL)
{
fast=fast->next;
slow=slow->next;
}
return slow;
}
return NULL;
}
返回链表中间节点值
猜你喜欢
转载自blog.csdn.net/weixin_43215068/article/details/88376683
今日推荐
周排行