测评会员优惠活动进行中 · 开通 VIP,有效期内测评不限次 VIP 优惠中 · 测评不限次 立即查看

A33242. 假设给定链表为: ,若调用 searchValue(head, 5) ,函数返回值为( )。int searchValue(ListNode* head, int target) { while (head != nullptr) { if (head->val == target) { return 1; } head = head->next; } return 0;}

单选题 困难

题目描述

假设给定链表为: ,若调用 searchValue(head, 5) ,函数返回值为(     )。

int searchValue(ListNode* head, int target) {

while (head != nullptr) {

if (head->val == target) {

return 1;

}

head = head->next;

}

return 0;

}

选项(单选)

上一题 下一题