int ListLinkSearch(Node *head)
{
if(head == NULL)
{
return FAILURE;
}
Node *current = head->next;
Node *middle = head->next;
int i = j = 0;
while(current != NULL)
{
if(i/2 > j)
{
j++;
current = current->next;
}
i++;
middle = middle->next;
}
return SUCCESS;
}
单链表查找中间元素
猜你喜欢
转载自blog.csdn.net/weixin_42720316/article/details/82950253
今日推荐
周排行