A node in linked list is declared as follows struct Node int
A node in linked list is declared as follows: struct Node {int item; Node *next;}; Node *p; Node \'head;//Display the data in a linked list to which head points. for (Node *cur =; cur |= NULL; cur = cur rightarrow next) leftarrow Fill in the appropriate cout
Solution
struct Node
{
int item;
Node *next;
};
Node *p;
Node *head;
for(Node *cur=head;cur!=NULL;cur=cur->next)// We have to start from the head and traverse the list
cout<<cur->item<<endl; //We have to display the element.
