Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Class notes

Proper class notes for Linked List

Rating
-
Sold
-
Pages
7
Uploaded on
10-05-2023
Written in
2022/2023

I have study and made notes very accurately. No need to watch video or if you do you have this notes to revise.

Institution
Course

Content preview

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

Written for

Course

Document information

Uploaded on
May 10, 2023
Number of pages
7
Written in
2022/2023
Type
Class notes
Professor(s)
Neso academy
Contains
All classes

Subjects

$10.79
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
furqanahmed

Get to know the seller

Seller avatar
furqanahmed Exam Questions
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
2 year
Number of followers
0
Documents
1
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions