?
Consider the following code snippet to search an element in a linked list:
Consider the following code snippet to search an element in a linked list:
struct Node
{
int val;
struct Node* next;
}*head;
int linear_search(int value)
{
struct Node *temp = head->next;
while(temp != 0)
{
if(temp->val == value)
return 1;
_________;
}
return 0;
}
Which of the following lines should be inserted to complete the above code?
struct Node
{
int val;
struct Node* next;
}*head;
int linear_search(int value)
{
struct Node *temp = head->next;
while(temp != 0)
{
if(temp->val == value)
return 1;
_________;
}
return 0;
}
Join the Discussion
Login to post a comment or share your explanation.
Login