Linked Lists questions

Q39

GATE CS 2026 CS-1Linear Data StructuresMCQ2 marks−2/3 if wrong
Consider the following code snippet in C language that computes the number of nodes in a non-empty singly linked list pointed to by the pointer variable head.
struct node{
 int elt;
 struct node *next;
};

int getListSize (struct node *head)
{
 if( E1 ) return 1;
 return E2;
}
Which one of the following options gives the correct replacements for the expressions E1 and E2?
Show answer without attempting

Answer: B

0/10 correct0 marks

Related topics in Linear Data Structures