Which of the following is the correct declaration of linked list?

2018

Which of the following is the correct declaration of linked list?

Answer: B. struct node { int data; struct node* link; };A linked list stores data elements in nodes, where each node contains: A data field

  1. A.

    struct node*

    {

    int data;

    node* link;

    };

  2. B.

    struct node

    {

    int data;

    struct node* link;

    };

  3. C.

    struct node

    {

    int data;

    node link;

    };

  4. D.

    struct node*

    {

    int data;

    struct node* link;

    };

Attempted by 1267 students.

Show answer & explanation

Correct answer: B

A linked list stores data elements in nodes, where each node contains: A data field

Explore the full course: Up Lt Grade Assistant Teacher 2025

Loading lesson…