166 views
0 votes
0 votes
Can Anyone Please explain this code!!!

 

 

#include <bits/stdc++.h>
using namespace std;

struct Node{
int data;
Node* next;
Node(int x){
data=x;
next=NULL;
}
};

void printlist(Node *head){
Node *curr=head;
while(curr!=NULL){
cout<<curr->data<<" ";
curr=curr->next;
}
}

int main()
{
Node *head=new Node(10);
head->next=new Node(20);
head->next->next=new Node(30);
head->next->next->next=new Node(40);
printlist(head);
return 0;
}

Please log in or register to answer this question.

Related questions

0 votes
0 votes
1 answer
1
gatecse asked Mar 2, 2018
188 views
Which of the following table implementation is based on the property of the locality of reference ?Hash tableSearch tableLinear listSelf organizing list
0 votes
0 votes
2 answers
2
gatecse asked Mar 2, 2018
756 views
Bluetooth uses ____ method in physical layer to avoid interference from other devices or other networksFHSSFDSSTDSNone of the above
0 votes
0 votes
1 answer
3
gatecse asked Mar 2, 2018
387 views
In which of the following search agent operates by interleaving computation and action?Offline searchOnline searchBreadth first searchDepth first search
0 votes
0 votes
1 answer
4
gatecse asked Mar 2, 2018
371 views
Which of the following deals with the precise model where accurate solutions are achieved quickly?Soft computingMobile computingHard computingNone of the above