Topics covered in this snack-sized chapter:

• A linked list is a data structure which can change during execution.
• Structure used for variable data set.
• Unlike an array, stores data non-contiguously.
• Each record of a linked list is often called an Element or Node.
• Consists of a sequence of nodes each of which contains a reference (i.e., a link) to the next node in the sequence.
• Linked lists allow insertion and removal of nodes at any point in the list.
• Various types of linked lists:
• The nodes of linked list contain two fields:
• Data field: an abstract data type.
• Next Field: a link to the next node.

• They can be used to implement:
• Queues and Stacks

• Singly linked lists contain nodes which have a data field as well as a next field, which points to the next node in the linked list.

• In a doubly linked list, each node contains, besides the next-node link, a second link field pointing to the previous node in the sequence. The two links may be called forward(s) and backwards, or next and previous.

• Circular List arrow_upward

• In the last node of a list, the link field often contains a null reference, a special value used to indicate the lack of further nodes.
• A less common convention is to make it point to the first node of the list; in that case the list is said to be circular or circularly linked; otherwise it is said to be open or linear.

• In a multiply linked list, each node contains two or more link fields, each field being used to connect the same set of data records in a different order (e.g., by name, by department, by date of birth, etc.).
• ```/*c program for creating singly linked list*/
#include<stdio.h>
#include<conio.h>
{
int age;
};
node *makenode(int );
int main()
{
int ag;
node *start,*last,*nn; //nn=new node
start=NULL;
while(1)
{
printf("Enter your age and if you want to exit, press 0 : ");
scanf("%d",&ag);
if(ag==0)
break;
nn=makenode(ag);
if(start==NULL)
{
start = nn;
last = nn;
}
else
{
last->next = nn;
last = nn;
}
}
for(; start!=NULL; start=start->next)
printf("%d\t",start->age);
getch();
return 0;
}
/*creation of node*/
node *makenode(int tmp)
{
node *nn;
nn = (node *)malloc(sizeof(node));
nn->age = tmp;
nn->next = NULL;
return nn;
}
```
OUTPUT:
```Enter your age and if you want to exit, press 0 : 25
Enter your age and if you want to exit, press 0 : 0