Skip to content
Related Articles
Open in App
Not now

Related Articles

Data Structures | Linked List | Question 17

Improve Article
Save Article
  • Difficulty Level : Easy
  • Last Updated : 28 Jun, 2021
Improve Article
Save Article

Consider the following function to traverse a linked list.




void traverse(struct Node *head)
{
   while (head->next != NULL)
   {
       printf("%d  ", head->data);
       head = head->next;
   }
}


Which of the following is FALSE about above function?
(A) The function may crash when the linked list is empty
(B) The function doesn’t print the last node when the linked list is not empty
(C) The function is implemented incorrectly because it changes head


Answer: (C)

Explanation:

Quiz of this Question

My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!