1,933 views
0 votes
0 votes

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

Please log in or register to answer this question.

Related questions

2 votes
2 votes
1 answer
2
Rishav Kumar Singh asked Jun 15, 2018
2,886 views
Which data structure is most efficient to find the top 10 largest items out of 1 million items stored in file?AMin heapBMax heapCBSTDSorted array
0 votes
0 votes
1 answer
4
atulcse asked Jan 15, 2022
679 views
How many minimum relations are required for the following Relation R(A, B, C, D, E) with FD {A → BC, CD → E, B → D, E → A} to convert into BCNF without violation ...