SlideShare uma empresa Scribd logo
1 de 19
Taslima Yasmin Tarin
2015-2-50-022
linked list is a linear data structure.
• Linked list is a collection of elements called
nodes.
• Each node contains two parts. they are
data part and link part.
data link
LINKED LISTS
• The above figure shows the example of marks
obtained by different students can be stored in a
linked list
Here N-stands for NULL.
Null indicates the end of the node.
14 100 30 400 42 N
TYPES OF LINKED LISTS
1. Single linked list
2. Double linked list
OPERATIONS ON LINKED LISTS
The basic operations on linked lists are
1. Creation
2. Insertion
3. Deletion
4. Traversing
5. Searching
Creation
Insertion
There are 3 cases here:-
Insertion at the
beginning
Insertion at the end
Insertion after a
particular node
The creation operation is used to create a
linked list
Insertion at the beginning
There are two steps to be followed:-
a)Make the next pointer of the node point towards the
first node of the list
b)Make the start pointer point towards this new node
 If the list is empty simply make the start pointer point
towards the new node;
Inserting at the end
Here we simply need to make the next pointer
of the last node point to the new node
Inserting after an element
Here we again need to do 2 steps :-
 Make the next pointer of the node to be inserted point to
the next node of the node after which you want to insert
the node
 Make the next pointer of the node after which the node is
to be inserted, point to the node to be inserted
Deleting a node
Here also we have three cases:-
 Deleting the first node
Deleting the last node
Deleting the intermediate node
Deleting the first node
Here we apply 2 steps:-
 Making the start pointer point towards the 2nd
node
 Deleting the first node using delete keyword
 start
threetwoone
Deleting the last node
start
Here we apply 2 steps:-
 Making the second last node’s next pointer point to NULL
 Deleting the last node via delete keyword
node3node2node1
Deleting a particular node
Here we make the next pointer of the node previous to
the node being deleted ,point to the successor node of
the node to be deleted and then delete the node using
delete keyword
node1 node2 node3
Searching
Traversing
Searching operation is a process of accessing the
desired node in the list. We start searching node –
by-node and compare the data of the node with
the key.
Traversing operation is a process of going
through all the nodes of a linked list from one
end to the another end. If we start traversing
from the very first node towards the last node ,
It is called forward traversing.
ADVANTAGES OF LINKED LISTS
We can dynamically allocate memory space as
needed
We can release the unused space in the situation
where the allocated space seems to be more.
Operation related to data elements like insertions
or deletion are more simplified.
Operation like insertion or deletion are less time
consuming.
Linked lists provide flexibility in allowing the
items to be arranged efficiently.
LIMITATIONS OF LINKED LISTS
When ever we deal with fixed length
lists it would be better to use an array
rather than linked list.
Linked list will consume more storage
space than an array with same number of
items this is because each item has an
addition link field
APPLICATIONS
Linked lists are used in many other data
structures.
Linked lists are used in polynomial
manipulation.
Representation of trees, stacks, queues.
etc.,

Mais conteúdo relacionado

Mais procurados

Introduction to stack
Introduction to stackIntroduction to stack
Introduction to stack
vaibhav2910
 

Mais procurados (20)

Stacks in c++
Stacks in c++Stacks in c++
Stacks in c++
 
Linear data structure concepts
Linear data structure conceptsLinear data structure concepts
Linear data structure concepts
 
Linked list
Linked listLinked list
Linked list
 
Double Linked List (Algorithm)
Double Linked List (Algorithm)Double Linked List (Algorithm)
Double Linked List (Algorithm)
 
linked lists in data structures
linked lists in data structureslinked lists in data structures
linked lists in data structures
 
Data Structure and Algorithms Linked List
Data Structure and Algorithms Linked ListData Structure and Algorithms Linked List
Data Structure and Algorithms Linked List
 
Data Structures - Lecture 9 [Stack & Queue using Linked List]
 Data Structures - Lecture 9 [Stack & Queue using Linked List] Data Structures - Lecture 9 [Stack & Queue using Linked List]
Data Structures - Lecture 9 [Stack & Queue using Linked List]
 
Linked list in Data Structure and Algorithm
Linked list in Data Structure and Algorithm Linked list in Data Structure and Algorithm
Linked list in Data Structure and Algorithm
 
Queue in Data Structure
Queue in Data Structure Queue in Data Structure
Queue in Data Structure
 
Linked list
Linked listLinked list
Linked list
 
Introduction to stack
Introduction to stackIntroduction to stack
Introduction to stack
 
Data Structures - Lecture 7 [Linked List]
Data Structures - Lecture 7 [Linked List]Data Structures - Lecture 7 [Linked List]
Data Structures - Lecture 7 [Linked List]
 
Link list
Link listLink list
Link list
 
Priority queue in DSA
Priority queue in DSAPriority queue in DSA
Priority queue in DSA
 
Doubly linked list (animated)
Doubly linked list (animated)Doubly linked list (animated)
Doubly linked list (animated)
 
Linked list
Linked listLinked list
Linked list
 
Introduction to data structure
Introduction to data structure Introduction to data structure
Introduction to data structure
 
Binary search tree operations
Binary search tree operationsBinary search tree operations
Binary search tree operations
 
Array ADT(Abstract Data Type)|Data Structure
Array ADT(Abstract Data Type)|Data StructureArray ADT(Abstract Data Type)|Data Structure
Array ADT(Abstract Data Type)|Data Structure
 
Linked List, Types of Linked LIst, Various Operations, Applications of Linked...
Linked List, Types of Linked LIst, Various Operations, Applications of Linked...Linked List, Types of Linked LIst, Various Operations, Applications of Linked...
Linked List, Types of Linked LIst, Various Operations, Applications of Linked...
 

Semelhante a Linkedlist

Semelhante a Linkedlist (20)

data structures and applications power p
data structures and applications power pdata structures and applications power p
data structures and applications power p
 
linked list in data structure
linked list in data structure linked list in data structure
linked list in data structure
 
Linked list (1).pptx
Linked list (1).pptxLinked list (1).pptx
Linked list (1).pptx
 
ds-lecture-4-171012041008 (1).pdf
ds-lecture-4-171012041008 (1).pdfds-lecture-4-171012041008 (1).pdf
ds-lecture-4-171012041008 (1).pdf
 
linked list using c
linked list using clinked list using c
linked list using c
 
Linked lists
Linked listsLinked lists
Linked lists
 
Linkedlists
LinkedlistsLinkedlists
Linkedlists
 
Linked list
Linked listLinked list
Linked list
 
Linked List in Data Structure
Linked List in Data StructureLinked List in Data Structure
Linked List in Data Structure
 
Linked List, basics , types , operations
Linked List, basics , types , operationsLinked List, basics , types , operations
Linked List, basics , types , operations
 
Deletion from single way linked list and search
Deletion from single way linked list and searchDeletion from single way linked list and search
Deletion from single way linked list and search
 
Singly linked list
Singly linked listSingly linked list
Singly linked list
 
1.3 Linked List.pptx
1.3 Linked List.pptx1.3 Linked List.pptx
1.3 Linked List.pptx
 
linked list
linked list linked list
linked list
 
Data Structures_Linked List
Data Structures_Linked ListData Structures_Linked List
Data Structures_Linked List
 
Operations on linked list
Operations on linked listOperations on linked list
Operations on linked list
 
Linked list
Linked listLinked list
Linked list
 
Linked list.pptx
Linked list.pptxLinked list.pptx
Linked list.pptx
 
Linked list.docx
Linked list.docxLinked list.docx
Linked list.docx
 
Doubly & Circular Linked Lists
Doubly & Circular Linked ListsDoubly & Circular Linked Lists
Doubly & Circular Linked Lists
 

Mais de Taslima Yasmin Tarin

Mais de Taslima Yasmin Tarin (15)

Restaurant management system
Restaurant management systemRestaurant management system
Restaurant management system
 
RSA algorithem
RSA algorithemRSA algorithem
RSA algorithem
 
CDMA
CDMACDMA
CDMA
 
Mobile Satellite Communication
Mobile Satellite CommunicationMobile Satellite Communication
Mobile Satellite Communication
 
Application of DSP in Biomedical science
Application of DSP in Biomedical scienceApplication of DSP in Biomedical science
Application of DSP in Biomedical science
 
Real Life Application of Digital Electronics
Real Life Application of Digital ElectronicsReal Life Application of Digital Electronics
Real Life Application of Digital Electronics
 
GPS (Global Positioning System) application
GPS (Global Positioning System) applicationGPS (Global Positioning System) application
GPS (Global Positioning System) application
 
Artificial intelligence chatbot Report
Artificial intelligence chatbot ReportArtificial intelligence chatbot Report
Artificial intelligence chatbot Report
 
AI chatbot for massenger
AI chatbot for massengerAI chatbot for massenger
AI chatbot for massenger
 
file compression/zip file.report
file compression/zip file.reportfile compression/zip file.report
file compression/zip file.report
 
file compression ,zip file
file compression ,zip filefile compression ,zip file
file compression ,zip file
 
Bangali
BangaliBangali
Bangali
 
oscillator
oscillatoroscillator
oscillator
 
farakka barrage
farakka barragefarakka barrage
farakka barrage
 
Operation Amplifire
Operation AmplifireOperation Amplifire
Operation Amplifire
 

Último

1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
AldoGarca30
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdf
Kamal Acharya
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakes
MayuraD1
 

Último (20)

Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
Computer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersComputer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to Computers
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS Lambda
 
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxA CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdf
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdf
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 
Wadi Rum luxhotel lodge Analysis case study.pptx
Wadi Rum luxhotel lodge Analysis case study.pptxWadi Rum luxhotel lodge Analysis case study.pptx
Wadi Rum luxhotel lodge Analysis case study.pptx
 
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptxOrlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
 
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakes
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
Moment Distribution Method For Btech Civil
Moment Distribution Method For Btech CivilMoment Distribution Method For Btech Civil
Moment Distribution Method For Btech Civil
 
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARHAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
 
PE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and propertiesPE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and properties
 

Linkedlist

  • 2. linked list is a linear data structure. • Linked list is a collection of elements called nodes. • Each node contains two parts. they are data part and link part. data link LINKED LISTS
  • 3. • The above figure shows the example of marks obtained by different students can be stored in a linked list Here N-stands for NULL. Null indicates the end of the node. 14 100 30 400 42 N
  • 4. TYPES OF LINKED LISTS 1. Single linked list 2. Double linked list
  • 5. OPERATIONS ON LINKED LISTS The basic operations on linked lists are 1. Creation 2. Insertion 3. Deletion 4. Traversing 5. Searching
  • 6. Creation Insertion There are 3 cases here:- Insertion at the beginning Insertion at the end Insertion after a particular node The creation operation is used to create a linked list
  • 7. Insertion at the beginning There are two steps to be followed:- a)Make the next pointer of the node point towards the first node of the list b)Make the start pointer point towards this new node  If the list is empty simply make the start pointer point towards the new node;
  • 8.
  • 9. Inserting at the end Here we simply need to make the next pointer of the last node point to the new node
  • 10. Inserting after an element Here we again need to do 2 steps :-  Make the next pointer of the node to be inserted point to the next node of the node after which you want to insert the node  Make the next pointer of the node after which the node is to be inserted, point to the node to be inserted
  • 11.
  • 12. Deleting a node Here also we have three cases:-  Deleting the first node Deleting the last node Deleting the intermediate node
  • 13. Deleting the first node Here we apply 2 steps:-  Making the start pointer point towards the 2nd node  Deleting the first node using delete keyword  start threetwoone
  • 14. Deleting the last node start Here we apply 2 steps:-  Making the second last node’s next pointer point to NULL  Deleting the last node via delete keyword node3node2node1
  • 15. Deleting a particular node Here we make the next pointer of the node previous to the node being deleted ,point to the successor node of the node to be deleted and then delete the node using delete keyword node1 node2 node3
  • 16. Searching Traversing Searching operation is a process of accessing the desired node in the list. We start searching node – by-node and compare the data of the node with the key. Traversing operation is a process of going through all the nodes of a linked list from one end to the another end. If we start traversing from the very first node towards the last node , It is called forward traversing.
  • 17. ADVANTAGES OF LINKED LISTS We can dynamically allocate memory space as needed We can release the unused space in the situation where the allocated space seems to be more. Operation related to data elements like insertions or deletion are more simplified. Operation like insertion or deletion are less time consuming. Linked lists provide flexibility in allowing the items to be arranged efficiently.
  • 18. LIMITATIONS OF LINKED LISTS When ever we deal with fixed length lists it would be better to use an array rather than linked list. Linked list will consume more storage space than an array with same number of items this is because each item has an addition link field
  • 19. APPLICATIONS Linked lists are used in many other data structures. Linked lists are used in polynomial manipulation. Representation of trees, stacks, queues. etc.,