Vidyalelo
Data Structure · Q873

Miscellaneous on Data Structures

Programming · Data Structure · question 873

Q873

Consider the following recursive implementation of linear search on a linked list: 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 _________; 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)
Answer

Answer: Option D

Solution

Answer: Option D
No explanation is given for this question Let's Discuss on Board