C. [GESP]L5-202609-Q4271-S
[GESP]L5-202609-Q4271-S
该比赛已结束,您无法在比赛模式下递交该题目。您可以点击“在题库中打开”以普通模式查看和递交本题。
下面函数使用快慢指针查找单链表的中间结点。横线处应填写( )。
struct Node {
int value;
Node *next;
};
Node *middle(Node *head) {
Node *slow = head;
Node *fast = head;
while (fast != nullptr && fast->next != nullptr) {
slow = slow->next;
______________________
}
return slow;
}
{{ select(1) }}
fast = fast->next;fast = fast->next->next;fast = slow->next;fast = head->next;
GESP 2026.09 C++ 五级 全真模拟赛
- 状态
- 已结束
- 规则
- OI
- 题目
- 27
- 开始于
- 2026-11-20 13:35
- 结束于
- 2026-11-25 13:35
- 持续时间
- 2 小时
- 主持人
- 参赛人数
- 0