3. CONTENTS
Introduction of Linked list.
Advantages and disadvantages of Linked list.
Comparing B/W Array and Linked list.
Singly linked list.
Schematic represenatation of Single linked list.
Basic operations on a Single linked list.
Creating a Link List.
Displaying a Link List.
Inserting an element in Link List(Front, Mid, End).
Deleting an element from Link List(Front, Mid, End).,
5. What are Linked Lists?
A linked list is a linear data
structure.
Nodes make up linked lists.
Nodes are structures made up of
data and a pointer to another
node.
Usually the pointer is called next.
It is a collection of nodes with
various fields.
It contains Data field and
Address field or Link field.
Pointer to the
first node
Info field
Link Field/
Address Field
6. Link list is an ordered collection
of elements called Nodes.
Each node has two parts
1) Data part – It is used to hold
the data or information.
2) Pointer part – It is used to
hold the address of next node or
previous node.
( i.e. Link to the next node)
NODE :
DATA
NEXT
7. Advantages:
1. Link list are dynamic data structure.
2. Efficient memory utilization.
3. Insertion and deletion are easier.
Disadvantages:
1. If the number of fields are more then more memory
space is needed.
2. Access to an data item is little bit time consuming.
8. Linked List
What are the problems with Arrays
-Size is fixed
-Array Items are stored contiguously
-Insertions and deletion at particular position is complex
Why Linked list ?
-Size is not fixed , Grow and contract according to
insertions and deletions.
-Data can be stored at any place
-Insertions and deletions are simple and faster
10. Singly Linked list
Each Node contain address of the next node to be followed.
In Singly Linked List only Linear or Forward Sequential movement
is possible Hence it is also called linear link list.
Elements are accessed sequentially , no direct access is allowed.
First Node does not have predecessor while last node does not
have any successor.
It mainly contains two parts:
1.Data part-It is used to hold the data or information.
2.Address part-It is used to hold the address of the next node.
Link part of the last node contains NULL value which signifies the
end of the node.
1000 2000
First
10 15 NULL20
4000
1000 2000
11. Schematic representation:
Here is a singly-linked list (SLL):
a b c d
Start
• Each node has only one link part.
• Each node contains a value(data) and a pointer to
the next node in the list.
•All nodes are connected to each other through Link
Fields.
•Start is the header pointer which points at the first
node in the list
12. Basic operations in Single Link Lists
• Creating a Link List.
• Displaying a Link List.
• Inserting an element in Link List(Front, Mid, End).
• Deleting an element from Link List(Front, Mid, End).