SlideShare a Scribd company logo
Link list
Supervised
Dr Nuri
Prepared by
Didar Rashad
2014-2015
Linked Lists
Linked Lists 2
Link list
Link list in data structure
Introduction to Linked List
1.Link list is a data Structure which consists of group
of nodes that forms a sequence.
2. Linked list is group of nodes in which each node
have link to next node to form a chain,
Linked List definition
1. Linked List is Series of Nodes
2. Each node Consist of two Parts Data Part & Pointer Part
3. Data part stores value of node Pointer Part stores the address of the next node
Linked List Types
 Singly Linked list
 Circular singly linked list
 Doubly linked lists
 Circular doubly linked lists
Singly Linked List
10 1000 200015 NULL20
First
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.
 Elements are accessed sequentially , no direct access is
allowed.
 First Node does not have predecessor while last node
does not have any successor.
 We can have multiple data fields inside Node but we have
only single “Link” for next node.
10004000
10 1000
2000
200015 400020
Circular Singly Linked List
Last node contains the address of the first node
First
Circular Singly Linked List
Doubly linked lists
 In Doubly Linked List , each node contain two
address fields .
 One address field for storing address of next
node to be followed and second address field
contain address of previous node linked to it.
 So Two way access is possible ,We can start
accessing nodes from start as well as from last .
 Like Singly Linked List also only Linear but
Bidirectional Sequential movement is
possible.
3000
2000 30001000
10 15 202000 1000 2000 10003000
First
Circular Doubly Linked list
Contains the address of first node and last
node
3000
2000 30001000
10 15 202000 1000 2000 10003000
First
Difference Between array and
Linked List
Access
Randomsequential
Memory Structure
Memory Allocation
Insert deletion
Difference Between
array and Linked List
array elements can be randomly Accessed
using Subscript Variable
, a[0],a[1],a[3] can be randomly accessed
While In Linked List We have to Traverse Through the
Linked List for Accessing Element.
So O(n) Time required for Accessing Element .
Generally In linked List Elements are
accessed Sequentially.
Access
Randomsequential
Memory Structure
But link list is not necessary to store next
element at the Consecutive memory
Location
In link list Element is stored at any
available Location , but the Pointer to that
memory location is stored in Previous
Node.
array is stored in contiguous
Memory Locations , i.e Suppose first
element is Stored at 2000 then Second
Integer element will be stored at 2001 .
As the Array elements are stored in contiguous
memory Locations , so While Inserting elements ,we
have to create space for Insertion.
So More time required for Creating space and
Inserting Element
Similarly We have to Delete the Element from given
Location and then Shift All successive elements up
by 1 position
Insert deletion
In Linked List we have to Just Change the Pointer
address field (Pointer),So Insertion and Deletion
Operations are quite easy to implement
Insert deletion
Memory Should be allocated at Compile-Time in
array .
at the time when Programmer is Writing Program,
array uses Static Memory Allocation
In Linked list memory can be allocated
at Run-Time ,
After executing Program
Linked List Uses Dynamic Memory
Allocation
Memory Allocation
Advantages of linked list
1.Linked List is Dynamic data Structure .
Linked List Data Structure is Dynamic in nature.
just create Linked List structure and memory will be allocated at run
time.
while running program at run time we can allocate much memory.
Oslo we can allocate any number of nodes .
Because this link list can grow and shrink during run time.
2. Insertion and Deletion Operations are Easier
Advantages of linked list
3. Efficient Memory Utilization , no need to pre-allocate memory
we don’t have to allocate memory at compile time.
Memory is allocated at run time,
so that Linked list data structure provides us strong
command on memory utilization.
4. Faster Access time , can be expanded in constant time
without memory overhead
5. Linear Data Structures such as array , Queue can be easily
implemented by using Linked list
Disadvantages of linked list
1. Wastage of memory
. Pointer Requires extra memory for
storage.
Suppose we want to store 3 integer data
items then we have to allocate memory -
in case of array
Memory Required in Array = 3 Integer *
Size
=3 * 2 bytes
= 6 bytes
Memory Required in LL = 3 Integer * Size of
Node
= 3 * Size of Node
Structure
= 3 * Size(data + address
pointer)
= 3 * (2 bytes + x bytes)
Disadvantages of linked list
2. No random Access
In Linked list no random access is given to user, we have
to access each node sequentially.
3. Heap space restriction
Whenever memory is dynamically allocated , It utilizes memory from heap.
Memory is allocated to Linked List at run time if only there is space
available in heap.
If there is insufficient space in heap then it can’t create any memory.
4. Reverse Traversing is difficult
In case if we are using singly linked list then it is very difficult to traverse
linked list from end.
If using doubly linked list then though it becomes easier to traverse from
end to start
Insertion
 Doubly linked lists
21
A B X C
A B C
p
A B C
p
X
q
p q
Deletion
 Doubly linked lists
Linked Lists 22
A B C D
p
A B C
D
p
A B C
Thank you

More Related Content

PPTX
Linked list in Data Structure and Algorithm
PPTX
Linked list
PPT
Data Structures- Part7 linked lists
PPT
Linked List
PPT
Linked list
PPT
Doubly linked list
PPTX
Linear data structure concepts
PPTX
Stacks IN DATA STRUCTURES
Linked list in Data Structure and Algorithm
Linked list
Data Structures- Part7 linked lists
Linked List
Linked list
Doubly linked list
Linear data structure concepts
Stacks IN DATA STRUCTURES

What's hot (20)

PPT
Linked lists
PDF
Bca data structures linked list mrs.sowmya jyothi
PPTX
Searching and sorting
PPTX
Data Structures (CS8391)
PPT
Circular linked list
PPT
Linkedlist
PPTX
linked list in Data Structure, Simple and Easy Tutorial
PPTX
Linked list
PPT
B trees in Data Structure
PDF
Expression trees
PPTX
Binary Search Tree
PPTX
PPTX
Linked list
PPTX
Doubly Linked List
PPTX
Introduction to data structure
PPTX
Double Linked List (Algorithm)
PPTX
Priority Queue in Data Structure
PDF
Singly linked list
PPT
Queue Data Structure
Linked lists
Bca data structures linked list mrs.sowmya jyothi
Searching and sorting
Data Structures (CS8391)
Circular linked list
Linkedlist
linked list in Data Structure, Simple and Easy Tutorial
Linked list
B trees in Data Structure
Expression trees
Binary Search Tree
Linked list
Doubly Linked List
Introduction to data structure
Double Linked List (Algorithm)
Priority Queue in Data Structure
Singly linked list
Queue Data Structure
Ad

Similar to Link list (20)

PPTX
Data Structures-UNIT Four_Linked_List.pptx
PPTX
Different types of Linked list.
PPTX
Linked List Representation of a Linked List.pptx
 
PPTX
Data Structures and Algorithms - Lec 05.pptx
PPTX
Data Structures Introduction & Linear DS
PPTX
linked list.pptx
DOCX
Linked List
PPT
Linkedlists
PPTX
link list.pptx complete notes detailed ans
PPTX
linked list in data structure
PPTX
1.3 Linked List.pptx
PDF
Linked list (introduction) 1
PDF
ds-lecture-4-171012041008 (1).pdf
PPTX
Linked list (1).pptx
PPTX
Linked Lists in Data Structures ppt .pptx
PPTX
Linked list
DOCX
Introduction to linked lists
PPTX
data structures and applications power p
DOCX
Link list assi
PPTX
Data Structure and Algorithms by Sabeen Memon03.pptx
Data Structures-UNIT Four_Linked_List.pptx
Different types of Linked list.
Linked List Representation of a Linked List.pptx
 
Data Structures and Algorithms - Lec 05.pptx
Data Structures Introduction & Linear DS
linked list.pptx
Linked List
Linkedlists
link list.pptx complete notes detailed ans
linked list in data structure
1.3 Linked List.pptx
Linked list (introduction) 1
ds-lecture-4-171012041008 (1).pdf
Linked list (1).pptx
Linked Lists in Data Structures ppt .pptx
Linked list
Introduction to linked lists
data structures and applications power p
Link list assi
Data Structure and Algorithms by Sabeen Memon03.pptx
Ad

Recently uploaded (20)

PDF
Download FL Studio Crack Latest version 2025 ?
PDF
Complete Guide to Website Development in Malaysia for SMEs
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PPTX
Oracle Fusion HCM Cloud Demo for Beginners
PDF
Nekopoi APK 2025 free lastest update
PPTX
Log360_SIEM_Solutions Overview PPT_Feb 2020.pptx
PDF
Tally Prime Crack Download New Version 5.1 [2025] (License Key Free
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PDF
Salesforce Agentforce AI Implementation.pdf
DOCX
Greta — No-Code AI for Building Full-Stack Web & Mobile Apps
PPTX
assetexplorer- product-overview - presentation
PPTX
AMADEUS TRAVEL AGENT SOFTWARE | AMADEUS TICKETING SYSTEM
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PPTX
Transform Your Business with a Software ERP System
PDF
Cost to Outsource Software Development in 2025
Download FL Studio Crack Latest version 2025 ?
Complete Guide to Website Development in Malaysia for SMEs
Adobe Illustrator 28.6 Crack My Vision of Vector Design
How to Choose the Right IT Partner for Your Business in Malaysia
Oracle Fusion HCM Cloud Demo for Beginners
Nekopoi APK 2025 free lastest update
Log360_SIEM_Solutions Overview PPT_Feb 2020.pptx
Tally Prime Crack Download New Version 5.1 [2025] (License Key Free
wealthsignaloriginal-com-DS-text-... (1).pdf
Salesforce Agentforce AI Implementation.pdf
Greta — No-Code AI for Building Full-Stack Web & Mobile Apps
assetexplorer- product-overview - presentation
AMADEUS TRAVEL AGENT SOFTWARE | AMADEUS TICKETING SYSTEM
Operating system designcfffgfgggggggvggggggggg
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Odoo Companies in India – Driving Business Transformation.pdf
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Transform Your Business with a Software ERP System
Cost to Outsource Software Development in 2025

Link list

  • 1. Link list Supervised Dr Nuri Prepared by Didar Rashad 2014-2015
  • 4. Link list in data structure Introduction to Linked List 1.Link list is a data Structure which consists of group of nodes that forms a sequence. 2. Linked list is group of nodes in which each node have link to next node to form a chain,
  • 5. Linked List definition 1. Linked List is Series of Nodes 2. Each node Consist of two Parts Data Part & Pointer Part 3. Data part stores value of node Pointer Part stores the address of the next node
  • 6. Linked List Types  Singly Linked list  Circular singly linked list  Doubly linked lists  Circular doubly linked lists
  • 7. Singly Linked List 10 1000 200015 NULL20 First 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.  Elements are accessed sequentially , no direct access is allowed.  First Node does not have predecessor while last node does not have any successor.  We can have multiple data fields inside Node but we have only single “Link” for next node.
  • 8. 10004000 10 1000 2000 200015 400020 Circular Singly Linked List Last node contains the address of the first node First Circular Singly Linked List
  • 9. Doubly linked lists  In Doubly Linked List , each node contain two address fields .  One address field for storing address of next node to be followed and second address field contain address of previous node linked to it.  So Two way access is possible ,We can start accessing nodes from start as well as from last .  Like Singly Linked List also only Linear but Bidirectional Sequential movement is possible. 3000 2000 30001000 10 15 202000 1000 2000 10003000 First
  • 10. Circular Doubly Linked list Contains the address of first node and last node 3000 2000 30001000 10 15 202000 1000 2000 10003000 First
  • 11. Difference Between array and Linked List Access Randomsequential Memory Structure Memory Allocation Insert deletion Difference Between array and Linked List
  • 12. array elements can be randomly Accessed using Subscript Variable , a[0],a[1],a[3] can be randomly accessed While In Linked List We have to Traverse Through the Linked List for Accessing Element. So O(n) Time required for Accessing Element . Generally In linked List Elements are accessed Sequentially. Access Randomsequential
  • 13. Memory Structure But link list is not necessary to store next element at the Consecutive memory Location In link list Element is stored at any available Location , but the Pointer to that memory location is stored in Previous Node. array is stored in contiguous Memory Locations , i.e Suppose first element is Stored at 2000 then Second Integer element will be stored at 2001 .
  • 14. As the Array elements are stored in contiguous memory Locations , so While Inserting elements ,we have to create space for Insertion. So More time required for Creating space and Inserting Element Similarly We have to Delete the Element from given Location and then Shift All successive elements up by 1 position Insert deletion
  • 15. In Linked List we have to Just Change the Pointer address field (Pointer),So Insertion and Deletion Operations are quite easy to implement Insert deletion
  • 16. Memory Should be allocated at Compile-Time in array . at the time when Programmer is Writing Program, array uses Static Memory Allocation In Linked list memory can be allocated at Run-Time , After executing Program Linked List Uses Dynamic Memory Allocation Memory Allocation
  • 17. Advantages of linked list 1.Linked List is Dynamic data Structure . Linked List Data Structure is Dynamic in nature. just create Linked List structure and memory will be allocated at run time. while running program at run time we can allocate much memory. Oslo we can allocate any number of nodes . Because this link list can grow and shrink during run time. 2. Insertion and Deletion Operations are Easier
  • 18. Advantages of linked list 3. Efficient Memory Utilization , no need to pre-allocate memory we don’t have to allocate memory at compile time. Memory is allocated at run time, so that Linked list data structure provides us strong command on memory utilization. 4. Faster Access time , can be expanded in constant time without memory overhead 5. Linear Data Structures such as array , Queue can be easily implemented by using Linked list
  • 19. Disadvantages of linked list 1. Wastage of memory . Pointer Requires extra memory for storage. Suppose we want to store 3 integer data items then we have to allocate memory - in case of array Memory Required in Array = 3 Integer * Size =3 * 2 bytes = 6 bytes Memory Required in LL = 3 Integer * Size of Node = 3 * Size of Node Structure = 3 * Size(data + address pointer) = 3 * (2 bytes + x bytes)
  • 20. Disadvantages of linked list 2. No random Access In Linked list no random access is given to user, we have to access each node sequentially. 3. Heap space restriction Whenever memory is dynamically allocated , It utilizes memory from heap. Memory is allocated to Linked List at run time if only there is space available in heap. If there is insufficient space in heap then it can’t create any memory. 4. Reverse Traversing is difficult In case if we are using singly linked list then it is very difficult to traverse linked list from end. If using doubly linked list then though it becomes easier to traverse from end to start
  • 21. Insertion  Doubly linked lists 21 A B X C A B C p A B C p X q p q
  • 22. Deletion  Doubly linked lists Linked Lists 22 A B C D p A B C D p A B C

Editor's Notes

  • #3: 4/7/2015 11:07 AM