Đặng Thị Mỹ Linh
New member
Consider the following recursive implementation of linear search on a linked list:
Which of the following lines should be inserted to complete the above code?
A. 1
B. 0
C. linear_search(temp, value)
D. linear_search(temp->next, value)
Code:
struct Node
{
int val;
struct Node* next;
}*head;
int linear_search(struct Node *temp,int value)
{
if(temp == 0)
return 0;
if(temp->val == value)
return 1;
return _________;
}
A. 1
B. 0
C. linear_search(temp, value)
D. linear_search(temp->next, value)