Single Linked List
Single Linked List
Single Linked List
Node
100
Why are we using Single linked list instead of stack and Queue.
Data Next
10 NULL
Node1=(*struct Node)malloc(sizeof(*struct Node);
Node1->data=10;
Node1->next=NULL;
100
Node 1 If(head==NULL)
i.e: {
100->data=10; Head=node1;
100->next=NULL; }
Head=100
Data Next
10 NULL
100
Node 1
Head=100
10 NULL 20 NULL
200 temp=head;
While(temp->next!=NULL)
{
100 200 temp=temp->next;
Node 1 Node 2 }
Temp->next=node2;
Head=100 Node3=(*struct Node)malloc(sizeof(*struct Node);
While(temp->next!=NULL)
100 200 300
{
temp=temp->next;
Node 1 Node 2 Node 3 }
Temp->next=node3;
Head=100
Data Next Data Next Data Next Data Next Data Next
Data Next Data Next Data Next Data Next Data Next
100
500
100
500
newn
Inserting node at End
100
100
500
Inserting node at Middle
100
500
newn
Delete node at start
Delete node at middle
Delete node at End
Display
Search
• Search a particular node in the list.
Thank You