SlideShare a Scribd company logo
Dr. CHETHAN CHANDRA S BASAVARADDI
B.E., B.Ed., M.Tech., Ph.D., D.Litt., KEA-KSET.,
Associate Professor,
Dept. CSE, School of CS&T,
Faculty of Engineering Technology,
G M University,
Post Box No-4, PB Road,
Davanagere-577006,
Essential Operation on Linked Lists
 Traversing: To traverse all nodes one by one.
 Insertion: To insert new nodes at specific
positions.
 Deletion: To delete nodes from specific positions.
 Searching: To search for an element from the
linked list.
 Traversal
 In this operation, you will display all the nodes in the linked list.
 When the temp is null, it means you traversed all the nodes, and you
reach the end of the linked list and get out from the while loop.
Insertion
 You can add a node at the beginning, middle,
and end.
 Insert at the Beginning
 Create a memory for a new node.
 Store data in a new node.
 Change next to the new node to point to start.
 Change starts to tell the recently created node.
Data Structures  and Algorithms-DSA_Linkedlist_class 2.pdf
Insert at the End
 Insert a new node and store data in it.
 Traverse the last node of a linked list
 Change the next pointer of the last node to the
newly created node.
Data Structures  and Algorithms-DSA_Linkedlist_class 2.pdf
Insert at the Middle
 Allocate memory and store data in the new
node.
 Traverse the node, which is just before the new
node.
 Change the next pointer to add a new node in
between.
Data Structures  and Algorithms-DSA_Linkedlist_class 2.pdf
Deletion
 You can also do deletion in the linked list in three
ways either from the end, beginning, or from a
specific position.
 Delete from the Beginning
 The point starts at the second node.
start = start -> next;
Delete from the End
 Traverse the second last element in the linked list.
 Change its next pointer to null.
Delete from the Middle
 Traverse the element before the element to be deleted.
 Change the next pointer to exclude the node from the linked list.
 For(int i=2; i<position; i++)
Searching
 The search operation is done to find a particular
element in the linked list. If the element is found
in any location, then it returns. Else, it will return
null.
Application of a Linked List
 A linked list is used to implement stacks and queues.
 A linked list also helps to implement an adjacency matrix
graph.
 It is used for the dynamic memory location.
 The linked list makes it easy to deal with the addition and
multiplication of polynomial operations.
 Implementing a hash table, each bucket of the hash
table itself behaves as a linked list.
 It is used in a functionality known as undo in Photoshop
and Word.
Types of Linked List in Data Structures
 A linked list is like a train where each bogie is
connected with links. Different types of linked lists
exist to make lives easier, like an image viewer,
music player, or when you navigate through
web pages.
Data Structures  and Algorithms-DSA_Linkedlist_class 2.pdf
There are four key types of linked lists:
 Singly linked lists
 Doubly linked lists
 Circular linked lists
 Circular doubly linked lists
Data Structures  and Algorithms-DSA_Linkedlist_class 2.pdf
Data Structures  and Algorithms-DSA_Linkedlist_class 2.pdf
Data Structures  and Algorithms-DSA_Linkedlist_class 2.pdf
Data Structures  and Algorithms-DSA_Linkedlist_class 2.pdf

More Related Content

PPTX
Datastucture-Unit 4-Linked List Presentation.pptx
PPTX
Linked list and its operations - Traversal
PPTX
Deletion from single way linked list and search
PPT
Linked list
PPTX
DS_Ch-2_Link-List_Midterm linear data structure.pptx
PPT
List data structure
PPT
List Data Structure
PPTX
1.3 Linked List.pptx
Datastucture-Unit 4-Linked List Presentation.pptx
Linked list and its operations - Traversal
Deletion from single way linked list and search
Linked list
DS_Ch-2_Link-List_Midterm linear data structure.pptx
List data structure
List Data Structure
1.3 Linked List.pptx

Similar to Data Structures and Algorithms-DSA_Linkedlist_class 2.pdf (20)

PPTX
Linked list in Data Structure and Algorithm
PPTX
Linked List Representation of a Linked List.pptx
PDF
Link list
PPTX
Engineering.CSE.DataStructure.Linkedlist.notes
DOCX
Linked list.docx
PPTX
PPT
Operations on linked list
PPT
Lecture 3 List of Data Structures & Algorithms
PPTX
Linked List Presentation in data structurepptx
PPTX
DSL Unit 4 (Linked list) (PPT)SE3rd sem sppu.pptx
PPTX
link list.pptx complete notes detailed ans
PPTX
deletionfromsinglewaylinkedlistandsearch-180407173723.pptx
PPTX
deletionfromsinglewaylinkedlistandsearch-180407173723.pptx
PPTX
deletionfromsinglewaylinkedlistandsearch-180407173723.pptx
PPTX
deletionfromsinglewaylinkedlistandsearch-180407173723.pptx
PPT
Linked List
PPT
Link list using array in Data structure amd algorithms
PPT
Linked list1.ppt
PDF
computer notes - Linked list
PPT
Linkedlists
Linked list in Data Structure and Algorithm
Linked List Representation of a Linked List.pptx
Link list
Engineering.CSE.DataStructure.Linkedlist.notes
Linked list.docx
Operations on linked list
Lecture 3 List of Data Structures & Algorithms
Linked List Presentation in data structurepptx
DSL Unit 4 (Linked list) (PPT)SE3rd sem sppu.pptx
link list.pptx complete notes detailed ans
deletionfromsinglewaylinkedlistandsearch-180407173723.pptx
deletionfromsinglewaylinkedlistandsearch-180407173723.pptx
deletionfromsinglewaylinkedlistandsearch-180407173723.pptx
deletionfromsinglewaylinkedlistandsearch-180407173723.pptx
Linked List
Link list using array in Data structure amd algorithms
Linked list1.ppt
computer notes - Linked list
Linkedlists
Ad

More from Chethan Raddi (7)

PDF
Data Structures and Algorithms-DSA_Linkedlist_class 7.pdf
PDF
Data Structures and Algorithms-DSA_Linkedlist_class 8.pdf
PDF
Data Structures and Algorithms-DSA_Linkedlist_class 6.pdf
PDF
Data Structures and Algorithms-DSA_Linkedlist_class 3.pdf
PDF
Data Structures and Algorithms-DSA_Linkedlist_class 4.pdf
PDF
Data Structures and Algorithms-DSA_Linkedlist_class 5.pdf
PDF
Data Structures and Algorithms-DSA_Linkedlist_class 1.pdf
Data Structures and Algorithms-DSA_Linkedlist_class 7.pdf
Data Structures and Algorithms-DSA_Linkedlist_class 8.pdf
Data Structures and Algorithms-DSA_Linkedlist_class 6.pdf
Data Structures and Algorithms-DSA_Linkedlist_class 3.pdf
Data Structures and Algorithms-DSA_Linkedlist_class 4.pdf
Data Structures and Algorithms-DSA_Linkedlist_class 5.pdf
Data Structures and Algorithms-DSA_Linkedlist_class 1.pdf
Ad

Recently uploaded (20)

PPT
introduction to datamining and warehousing
PPT
Project quality management in manufacturing
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PPTX
Construction Project Organization Group 2.pptx
PDF
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
PPTX
Artificial Intelligence
PPTX
Lecture Notes Electrical Wiring System Components
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PPT
Mechanical Engineering MATERIALS Selection
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PDF
R24 SURVEYING LAB MANUAL for civil enggi
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PDF
composite construction of structures.pdf
PPTX
CH1 Production IntroductoryConcepts.pptx
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PPTX
Sustainable Sites - Green Building Construction
introduction to datamining and warehousing
Project quality management in manufacturing
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
Construction Project Organization Group 2.pptx
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
Artificial Intelligence
Lecture Notes Electrical Wiring System Components
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
Mechanical Engineering MATERIALS Selection
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
R24 SURVEYING LAB MANUAL for civil enggi
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
Foundation to blockchain - A guide to Blockchain Tech
composite construction of structures.pdf
CH1 Production IntroductoryConcepts.pptx
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
Sustainable Sites - Green Building Construction

Data Structures and Algorithms-DSA_Linkedlist_class 2.pdf

  • 1. Dr. CHETHAN CHANDRA S BASAVARADDI B.E., B.Ed., M.Tech., Ph.D., D.Litt., KEA-KSET., Associate Professor, Dept. CSE, School of CS&T, Faculty of Engineering Technology, G M University, Post Box No-4, PB Road, Davanagere-577006,
  • 2. Essential Operation on Linked Lists  Traversing: To traverse all nodes one by one.  Insertion: To insert new nodes at specific positions.  Deletion: To delete nodes from specific positions.  Searching: To search for an element from the linked list.
  • 3.  Traversal  In this operation, you will display all the nodes in the linked list.  When the temp is null, it means you traversed all the nodes, and you reach the end of the linked list and get out from the while loop.
  • 4. Insertion  You can add a node at the beginning, middle, and end.  Insert at the Beginning  Create a memory for a new node.  Store data in a new node.  Change next to the new node to point to start.  Change starts to tell the recently created node.
  • 6. Insert at the End  Insert a new node and store data in it.  Traverse the last node of a linked list  Change the next pointer of the last node to the newly created node.
  • 8. Insert at the Middle  Allocate memory and store data in the new node.  Traverse the node, which is just before the new node.  Change the next pointer to add a new node in between.
  • 10. Deletion  You can also do deletion in the linked list in three ways either from the end, beginning, or from a specific position.  Delete from the Beginning  The point starts at the second node. start = start -> next;
  • 11. Delete from the End  Traverse the second last element in the linked list.  Change its next pointer to null.
  • 12. Delete from the Middle  Traverse the element before the element to be deleted.  Change the next pointer to exclude the node from the linked list.  For(int i=2; i<position; i++)
  • 13. Searching  The search operation is done to find a particular element in the linked list. If the element is found in any location, then it returns. Else, it will return null.
  • 14. Application of a Linked List  A linked list is used to implement stacks and queues.  A linked list also helps to implement an adjacency matrix graph.  It is used for the dynamic memory location.  The linked list makes it easy to deal with the addition and multiplication of polynomial operations.  Implementing a hash table, each bucket of the hash table itself behaves as a linked list.  It is used in a functionality known as undo in Photoshop and Word.
  • 15. Types of Linked List in Data Structures  A linked list is like a train where each bogie is connected with links. Different types of linked lists exist to make lives easier, like an image viewer, music player, or when you navigate through web pages.
  • 17. There are four key types of linked lists:  Singly linked lists  Doubly linked lists  Circular linked lists  Circular doubly linked lists