Introduction: In this tutorial we will create our linked list. Before writing code let's understand key words related to linked list: 1. Head: first node of the linked list is called the head of the list. and this node is most important. 2.Tail: last node is called the tail of the list which must points to null. step1: For creating the list first of all let's declare the structure of Nodes of the list: struct Node{ int val; struct Node *next; } step2: write main function: int main(){ int n; cout<<"enter the number of Nodes:"; cin>>n; struct Node* head = NULL; struct Node* temp; int m; while(n--){ cout<<"enter the data into nodes:"; cin>>m; ...
Programming for beginners