单选题 适中
#21363

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

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

int searchValue(ListNode* head, int target) {
	while (head != nullptr) {
		if (head->val == target) {
			return 1;
		}
		head = head->next;
	}
	return 0;
}
未登录也能判分,登录后才会记录
答案与解析
正确答案:A
这道题暂未补解析。