Skip to content

Beta · Data may be lost.Your data may be reset or lost.

GateBrew
← GATE CSE 2026 Set 1
Questions

Q29

MCQ2 marks, −0.67Data structures

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\textbf{E1} and E2?\textbf{E2}?

Sign in to save attempts.

Solutions and discussion are hidden while you attempt this question. They open once you check or show the answer.