2,799 views
0 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.

Position:
Show:

Related questions

5 5 votes
0 0 answers
438
438 views
Kundan_Kumar asked Dec 15, 2024
438 views
Both array & linklist are sequential acces bus as per their requirments array is effieient for sequential acces & random acces but ,as linklist not that much efficient fo...
1 1 vote
2 2 answers
4.8k
4.8k views
pream sagar asked Jul 28, 2018
4,821 views
If arity of operators is fixed, then which of the following notations can be used to parse expressions without parentheses? a) Infix Notation (Inorder traversal of a expr...
2 2 votes
1 answers 1 answer
3.8k
3.8k views
Rishav Kumar Singh asked Jun 15, 2018
3,827 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 0 votes
1 1 answer
350
350 views
Tankut asked Jul 25, 2025
350 views
A system has 24 bit instructions and it supports zero address, one address and two address instructions. Address field size is 8 bit. It is designed to support 255 number...