L4-Linked data structure link list and details.ppt
pallabistu2017
0 views
35 slides
Oct 12, 2025
Slide 1 of 35
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
About This Presentation
Linked data structure link list and details
Size: 863.64 KB
Language: en
Added: Oct 12, 2025
Slides: 35 pages
Slide Content
Linked ListsLinked Lists
Menu
CSE@DIUCSE@DIU
struct node {
int data;
struct node* next;
};
typedef struct node Node;
typedef struct node* List;
List Initialize();
void InsertBegin(List l,int d);
void InsertEnd(List l, int d);
void Insert(List l, Node* pos,int d);
Node* Find(List l,int d);
void Delete(List l, int d);
Menu
CSE@DIUCSE@DIU
MenuMenu
Initialize
InsertBegin
InsertEnd
Insert
Find
Delete
Menu
CSE@DIUCSE@DIU
InitializeInitialize
Menu
CSE@DIUCSE@DIU
List Initialize()
{
Node* temp;
temp = (Node*)calloc(1,sizeof(Node));
return temp;
}
Menu
CSE@DIUCSE@DIU
List Initialize()
{
Node* temp;
temp = (Node*)calloc(1,sizeof(Node));
return temp;
}
X
head
main()
{
List head;
head = Initialize();
}
Menu
CSE@DIUCSE@DIU
InsertBeginInsertBegin
Menu
CSE@DIUCSE@DIU
X
head
110846325
Menu
CSE@DIUCSE@DIU
X
head
110846325
void InsertBegin(List head,int d)
{
Node* temp;
temp = (Node*)calloc(1,sizeof(Node));
temp->data = d;
temp->next = head->next;
head->next = temp;
}
Menu
CSE@DIUCSE@DIU
X
head
110846325
void InsertBegin(List head,int d)
{
Node* temp;
temp = (Node*)calloc(1,sizeof(Node));
temp->data = d;
temp->next = head->next;
head->next = temp;
}
1
Menu
CSE@DIUCSE@DIU
X
head
110846325
1
Menu
CSE@DIUCSE@DIU
110846325
void InsertBegin(List head,int d)
{
Node* temp;
temp = (Node*)calloc(1,sizeof(Node));
temp->data = d;
temp->next = head->next;
head->next = temp;
}
X
head
1
Menu
CSE@DIUCSE@DIU
110846325
void InsertBegin(List head,int d)
{
Node* temp;
temp = (Node*)calloc(1,sizeof(Node));
temp->data = d;
temp->next = head->next;
head->next = temp;
}
X
head
1
Menu
CSE@DIUCSE@DIU
110846325
void InsertBegin(List head,int d)
{
Node* temp;
temp = (Node*)calloc(1,sizeof(Node));
temp->data = d;
head->next = temp;
temp->next = head->next;
}
X
head
1
Menu
CSE@DIUCSE@DIU
X
head
110846325
1
void InsertBegin(List head,int d)
{
Node* temp;
temp = (Node*)calloc(1,sizeof(Node));
temp->data = d;
temp->next = head->next;
head->next = temp;
}
Menu
CSE@DIUCSE@DIU
X
head
110846325
1
10
void InsertBegin(List head,int d)
{
Node* temp;
temp = (Node*)calloc(1,sizeof(Node));
temp->data = d;
temp->next = head->next;
head->next = temp;
}
Menu
CSE@DIUCSE@DIU
X
head
110846325
1
10
void InsertBegin(List head,int d)
{
Node* temp;
temp = (Node*)calloc(1,sizeof(Node));
temp->data = d;
head->next = temp;
temp->next = head->next;
}
Menu
CSE@DIUCSE@DIU
X
head
110846325
10 41 8
void Delete(List l,Node* p,int d)
{
Node *temp,*del;
temp = Find(l,d);
if(temp != NULL)
{
del = temp->next;
temp->next = del->next;
free(del);
}
}
Menu
CSE@DIUCSE@DIU
X
head
110846325
10 41 8
void Delete(List l,Node* p,int d)
{
Node *temp,*del;
temp = Find(l,d);
if(temp != NULL)
{
del = temp->next;
temp->next = del->next;
free(del);
}
}
temp del
Menu
CSE@DIUCSE@DIU
X
head
10846325
10 4 8
Menu
CSE@DIUCSE@DIU
int main
{
List l;
Node* temp;
l = Initialize();
InsertBegin(l,1);
InsertBegin(l,10);
InsertEnd(l,8);
temp = Find(l,8);
Insert(l,temp,4);
Delete(l,1);
}
Menu
CSE@DIUCSE@DIU
Enjoy Linking You in ListEnjoy Linking You in List