## Recent Post

In this list each and every nodes are linked with one another in only one direction from head node to tail node.Here each node has been divided into two parts-
1)Information/Data part- It holds any type of value which may be either numeric or string.

Pointer start points first/head node link part of each node points to the next node.last nodes link part is NULL,if contains null in the link part.it means it is last node of the list.

struct node
{
data_type variable_name;
}
eg:-
struct node
{
int info;
}

Singly linked list insertion in an empty list
start=null
struct node
{
int info;
}
struct node *tmp;
tmp=(struct node *)malloc (sizeof(struct node))
tmp--->info=10;
tmp--->info=info;
start=tmp

Singly linked list insertion at the beginning
first check node is empty or not

struct node
{
int info;
}
struct node *tmp;
tmp=(struct node *)malloc(sizeof(struct node))
tmp--->info=1;
start=tmp;

struct node *P;
P=start;
while(P!=null)
{
print P--->info;
}

Singly linked list insertion at the end-

struct node
{
int info;
struct node *tmp;
tmp=(struct node *)malloc(sizeof(struct node));
struct node *P;
P=start;
while(P!=null)

Insertion at nth position in singly linked list-
P=start
for(i=1;i<position-1&&P!=null;i++)
• Deletion of the only node
• Deletion at the end (last node)
• Deletion of the nth node
Deletion of the only node-

struct node *tmp;
tmp=start;
start=null;
free(tmp);
Deletion at the beginning of first node
struct node *tmp;
tmp=start;
start=start--->;
free(tmp);

Deletion at the end node (last node)
struct node *P;
P=start;