Linked List
1. A linked list is the most sought-after data structure when it
comes to handling dynamic data elements. In order to maintain
a list in memory, there are basically two ways available with us.
The first one is of course , by using array data structure. The
other one is using linked list data structures and these are
basically the data structures. A single linked list is a list made up
of nodes that consists of two parts. Data part contains the
actual data and the link part contains the address of the next
node of the list. This is not an array , this is a linked list. So
definitely the last element must be linked to the first element. In
order to access the first node of the linked list, we need a
pointer. With the help of the link part of the node, we can reach
the next node. I am representing the link between these nodes
using these arrows. As this pointer contains the address 1000 ,
so I am using this arrow. So basically, this whole list is now
accessible. We will see how to create a singly linked list
programmatically.
2. Now we will see the difference between an array and a single
linked list in terms of representation.. WE want to store a list of
numbers.. This is the list available in front of Us.. That is 23, 54,
78, 78 and 90. WE can use these two data structures to store this
list.. The nodes are scattered here and there in the memory
locations, but they are still connected with each other.. You can
see there is a pointer, head which is the pointer to the first node
, of the list.. I am assuming these addresses of course.. THis is
not something that I have taken from somewhere.. IT is
important because these nodes are not representing consecutive
memory locations.
3. Now we will learn how to create a singly linked list in C
programming.. The list must consist of three nodes. Apart from
this is the data that I have given over here. As an example are 45,
98 and 3.. The linked part of the first node should contain the
address of the second node. the third node link part should
contain null.. There is no way to access the first node of the list
or access this node at all right.. the head pointer is pointing to
the second node.. The next step is to update the link part of the
first node so that it can point to the second node, so it can now
point to the first.
4. This presentation is in the continuation of the previous
presentation where we have discussed how to create a singly
linked list. we will see in this lecture how to add this node to this
list.. in method one, we will simply create another pointer which
will point to the third note of the list. and finally using this current
pointer, we are trying to access the link part of the second node..
head is the pointer,, which is pointed to the first node of the list.
and by using this pointer, i can access the link part of it., but
there is a problem with this method. actually, we are
1. A linked list is the most sought-after data structure when it
comes to handling dynamic data elements. In order to maintain
a list in memory, there are basically two ways available with us.
The first one is of course , by using array data structure. The
other one is using linked list data structures and these are
basically the data structures. A single linked list is a list made up
of nodes that consists of two parts. Data part contains the
actual data and the link part contains the address of the next
node of the list. This is not an array , this is a linked list. So
definitely the last element must be linked to the first element. In
order to access the first node of the linked list, we need a
pointer. With the help of the link part of the node, we can reach
the next node. I am representing the link between these nodes
using these arrows. As this pointer contains the address 1000 ,
so I am using this arrow. So basically, this whole list is now
accessible. We will see how to create a singly linked list
programmatically.
2. Now we will see the difference between an array and a single
linked list in terms of representation.. WE want to store a list of
numbers.. This is the list available in front of Us.. That is 23, 54,
78, 78 and 90. WE can use these two data structures to store this
list.. The nodes are scattered here and there in the memory
locations, but they are still connected with each other.. You can
see there is a pointer, head which is the pointer to the first node
, of the list.. I am assuming these addresses of course.. THis is
not something that I have taken from somewhere.. IT is
important because these nodes are not representing consecutive
memory locations.
3. Now we will learn how to create a singly linked list in C
programming.. The list must consist of three nodes. Apart from
this is the data that I have given over here. As an example are 45,
98 and 3.. The linked part of the first node should contain the
address of the second node. the third node link part should
contain null.. There is no way to access the first node of the list
or access this node at all right.. the head pointer is pointing to
the second node.. The next step is to update the link part of the
first node so that it can point to the second node, so it can now
point to the first.
4. This presentation is in the continuation of the previous
presentation where we have discussed how to create a singly
linked list. we will see in this lecture how to add this node to this
list.. in method one, we will simply create another pointer which
will point to the third note of the list. and finally using this current
pointer, we are trying to access the link part of the second node..
head is the pointer,, which is pointed to the first node of the list.
and by using this pointer, i can access the link part of it., but
there is a problem with this method. actually, we are