2.10 Implementation of Doubly Linked List - Data
Structures
Jenny's Lectures CS IT
WE are going to represent a doubly-linked list Logically. We have discussed in previous video
introduction of doubly linked list. SO I hope you know the concept of structures how we can use
this structure in C language. WE will declare a variable either a variable or a pointer using that
variable or that pointer. We can access the members of structure. THe code to create. This
linked list code is very much similar to the singly linked list. A function that tells create so now I
'm going to write down that thing also. WE are going to create a node to store this data to insert
the data in the linked list. Initially, we assume that the slist list is empty right. New node is a
pointer pointer pointer that has been created and this point that is going to store what whatever
my loop will return that. 250. and whatever this malloc will return? Where you will we are going
to. store that thing in new node. So here you will write would new nodes. So this is how memory
dynamically the memory has been allocated to this new node...
Head is not a null now head is containing 250 so in that case, how we will insert so in else part
what you will write so now see in the linked list I have only 1 node. I will ask how to update this
link. How you will excess this part of this node. Then you will say ma'am. We have a pointer to
this node. When I want to insert a third node I have created another node running by running
this code again this node. We have inserted this to here the data here. Both the previous and
next pointer is containing null. Now If head is equal to null but head is 100, so head is not and
now we are going to do this else. How do you can access this thing using new node previous is
equal to you will store here what the address of previous one is in M. So I will write here M. now
what do you write in else part? Have you replayed this thing and this thing? How do you access
this part either using head or using M so here? I am accessing this using temp..
address of next node 1 link has been established now Second this how you can access this part
using new node. Previous. PRevious node previous is equal to whatever you will store here.
Address of previous node that is 200 from where we can get 200.. Previous is 200. So is
containing 200 which means new node will be pointing there. When you will create the fourth
node and we have the address of this previous node. The code for the display function for
displaying the content of this list is same as singly linked list function. In next video I will discuss
how to insert a node in singly. linked list at beginning also at any position also and at end also
and after that how to delete data..
Structures
Jenny's Lectures CS IT
WE are going to represent a doubly-linked list Logically. We have discussed in previous video
introduction of doubly linked list. SO I hope you know the concept of structures how we can use
this structure in C language. WE will declare a variable either a variable or a pointer using that
variable or that pointer. We can access the members of structure. THe code to create. This
linked list code is very much similar to the singly linked list. A function that tells create so now I
'm going to write down that thing also. WE are going to create a node to store this data to insert
the data in the linked list. Initially, we assume that the slist list is empty right. New node is a
pointer pointer pointer that has been created and this point that is going to store what whatever
my loop will return that. 250. and whatever this malloc will return? Where you will we are going
to. store that thing in new node. So here you will write would new nodes. So this is how memory
dynamically the memory has been allocated to this new node...
Head is not a null now head is containing 250 so in that case, how we will insert so in else part
what you will write so now see in the linked list I have only 1 node. I will ask how to update this
link. How you will excess this part of this node. Then you will say ma'am. We have a pointer to
this node. When I want to insert a third node I have created another node running by running
this code again this node. We have inserted this to here the data here. Both the previous and
next pointer is containing null. Now If head is equal to null but head is 100, so head is not and
now we are going to do this else. How do you can access this thing using new node previous is
equal to you will store here what the address of previous one is in M. So I will write here M. now
what do you write in else part? Have you replayed this thing and this thing? How do you access
this part either using head or using M so here? I am accessing this using temp..
address of next node 1 link has been established now Second this how you can access this part
using new node. Previous. PRevious node previous is equal to whatever you will store here.
Address of previous node that is 200 from where we can get 200.. Previous is 200. So is
containing 200 which means new node will be pointing there. When you will create the fourth
node and we have the address of this previous node. The code for the display function for
displaying the content of this list is same as singly linked list function. In next video I will discuss
how to insert a node in singly. linked list at beginning also at any position also and at end also
and after that how to delete data..