MCQOPTIONS
Saved Bookmarks
| 1. |
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? |
| A. | temp = next |
| B. | temp->next = temp |
| C. | temp->next = temp |
| D. | return 0 |
| Answer» D. return 0 | |