SlideShare a Scribd company logo
1 of 54
Data Structure
Link List
Unit-2
Linked List
• Linked List can be defined as collection of
objects called nodes that are randomly stored
in the memory.
• A node contains two fields i.e. data stored at
that particular address and the pointer which
contains the address of the next node in the
memory.
• The last node of the list contains pointer to
the null.
Each node holds its own data and the address of
the next node hence forming a chain like structure.
Linked Lists are used to create trees and graphs.
Types of Link List
Following are the types of linked list
• Singly Linked List.
• Doubly Linked List.
• Circular Linked List.
Insertion of node at particular position
Deleting node at Beginning of Link List
Deletion of node at the End of Link List
Deletion of node at the End of Link List
Deleting a particular node from Link List
Reversing the Link List
Reversing the Link List
Copying a Link List into other Link List
Merging Two Link List
Doubly Linked List
• A Doubly Linked List contains an extra memory
to store the address of the previous node,
together with the address of the next node and
data which are there in the singly linked list. So,
here we are storing the address of the next as
well as the previous nodes.
• The following is the structure of the node in the
Doubly Linked List(DLL):
Operations Performed on Two way Link List
• Traversing
• Searching
• Insertion
• Deletion
Traversing Two Way Link List
Two way link list can be traversed in both the directions i.e.
in forward direction as well as backward direction.
Searching Two Way Link List
• Traverse the list until the pointer becomes null. Keep
shifting pointer to its next and increasing by +1.
• Compare each element of the list with the item which
is to be searched.
• If the item matched with any node value then the
location of that value I will be returned from the
function else NULL is returned.
Insertion of node in Two way Link List
There are three cases while inserting node
• Insertion at the Beginning
• Insertion at the End
• Insertion at the Particular position
Inserting the node at the Beginning
Inserting the node at the End
Inserting the node at particular position
Deleting Node at Particular Position Two Way Link List
Deleting Last Node in Two Way Link List
Circular Link List
All Circular linked list is a list in which last node points
back to the first node instead of containing the Null pointer
in the next part of the last node.
Circular Singly Linked List
In a circular Singly linked list, the last node of the list
contains a pointer to the first node of the list. We can
have circular singly linked list as well as circular doubly
linked list.
We traverse a circular singly linked list until we reach
the same node where we started. The circular singly
liked list has no beginning and no ending. There is no
null value present in the next part of any of the nodes.
Operations on circular singly linked list
SN Operation Description
1 Insertion at beginning Adding a node in circular singly
linked list at the beginning.
2 Insertion at end Adding a node in circular singly
linked list at the end.
3 Deletion at beginning Removing a node in circular singly
linked list from beginning.
4 Deletion at end Removing a node in circular singly
linked list at the end.
5
Traversing
Visiting each element of the list at
least once in order to perform some
specific operation.
Circular Doubly Linked List
Circular doubly linked list is a more complexed type of
data structure in which a node contain pointers to its
previous node as well as the next node. Circular doubly
linked list doesn't contain NULL in any of the node. The
last node of the list contains the address of the first node
of the list. The first node of the list also contain address
of the last node in its previous pointer.
Operations on circular doubly linked list
:
SN Operation Description
1 Insertion at beginning Adding a node in circular doubly
linked list at the beginning.
2 Insertion at end Adding a node in circular doubly
linked list at the end.
3 Deletion at beginning Removing a node in circular doubly
linked list from beginning.
4 Deletion at end Removing a node in circular doubly
linked list at the end.
Advantages of a Circular linked list
• The list can be traversed from any node.
• Circular lists are the required data
structure when we want a list to be
accessed in a circle or loop.
• We can easily traverse to its previous
node in a circular linked list, which is not
possible in a singly linked list.
Disadvantages of Circular linked list
• If not traversed carefully, then we could
end up in an infinite loop because here
we don't have any NULL value to stop
the traversal.
• Operations in a circular linked list are
complex as compared to a singly linked
list and doubly linked list.
Link_List.pptx

More Related Content

What's hot

Queue implementation
Queue implementationQueue implementation
Queue implementationRajendran
 
Binary search tree operations
Binary search tree operationsBinary search tree operations
Binary search tree operationsKamran Zafar
 
Stacks in DATA STRUCTURE
Stacks in DATA STRUCTUREStacks in DATA STRUCTURE
Stacks in DATA STRUCTUREMandeep Singh
 
Different Sorting tecniques in Data Structure
Different Sorting tecniques in Data StructureDifferent Sorting tecniques in Data Structure
Different Sorting tecniques in Data StructureTushar Gonawala
 
Queue Data Structure
Queue Data StructureQueue Data Structure
Queue Data StructureZidny Nafan
 
linked list in Data Structure, Simple and Easy Tutorial
linked list in Data Structure, Simple and Easy Tutoriallinked list in Data Structure, Simple and Easy Tutorial
linked list in Data Structure, Simple and Easy TutorialAfzal Badshah
 
Binary search tree in data structures
Binary search tree in  data structuresBinary search tree in  data structures
Binary search tree in data structureschauhankapil
 
stack & queue
stack & queuestack & queue
stack & queuemanju rani
 
Data Structures- Part7 linked lists
Data Structures- Part7 linked listsData Structures- Part7 linked lists
Data Structures- Part7 linked listsAbdullah Al-hazmy
 
Deque and its applications
Deque and its applicationsDeque and its applications
Deque and its applicationsJsaddam Hussain
 
Priority Queue in Data Structure
Priority Queue in Data StructurePriority Queue in Data Structure
Priority Queue in Data StructureMeghaj Mallick
 
Linked list
Linked listLinked list
Linked listeShikshak
 
linked lists in data structures
linked lists in data structureslinked lists in data structures
linked lists in data structuresDurgaDeviCbit
 
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...Balwant Gorad
 
Stack and Queue
Stack and Queue Stack and Queue
Stack and Queue Apurbo Datta
 

What's hot (20)

Queue
QueueQueue
Queue
 
Queue implementation
Queue implementationQueue implementation
Queue implementation
 
Binary search tree operations
Binary search tree operationsBinary search tree operations
Binary search tree operations
 
Stacks in DATA STRUCTURE
Stacks in DATA STRUCTUREStacks in DATA STRUCTURE
Stacks in DATA STRUCTURE
 
Queues
QueuesQueues
Queues
 
Different Sorting tecniques in Data Structure
Different Sorting tecniques in Data StructureDifferent Sorting tecniques in Data Structure
Different Sorting tecniques in Data Structure
 
Queue Data Structure
Queue Data StructureQueue Data Structure
Queue Data Structure
 
Linked list
Linked listLinked list
Linked list
 
Data Structure (Queue)
Data Structure (Queue)Data Structure (Queue)
Data Structure (Queue)
 
linked list in Data Structure, Simple and Easy Tutorial
linked list in Data Structure, Simple and Easy Tutoriallinked list in Data Structure, Simple and Easy Tutorial
linked list in Data Structure, Simple and Easy Tutorial
 
Binary search tree in data structures
Binary search tree in  data structuresBinary search tree in  data structures
Binary search tree in data structures
 
stack & queue
stack & queuestack & queue
stack & queue
 
Data Structures- Part7 linked lists
Data Structures- Part7 linked listsData Structures- Part7 linked lists
Data Structures- Part7 linked lists
 
Deque and its applications
Deque and its applicationsDeque and its applications
Deque and its applications
 
Priority Queue in Data Structure
Priority Queue in Data StructurePriority Queue in Data Structure
Priority Queue in Data Structure
 
Linked List
Linked ListLinked List
Linked List
 
Linked list
Linked listLinked list
Linked list
 
linked lists in data structures
linked lists in data structureslinked lists in data structures
linked lists in data structures
 
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...
 
Stack and Queue
Stack and Queue Stack and Queue
Stack and Queue
 

Similar to Link_List.pptx

data structures and applications power p
data structures and applications power pdata structures and applications power p
data structures and applications power pMeghaKulkarni27
 
DATA STRUCTURES AND LINKED LISTS IN C.pptx
DATA STRUCTURES AND LINKED LISTS IN C.pptxDATA STRUCTURES AND LINKED LISTS IN C.pptx
DATA STRUCTURES AND LINKED LISTS IN C.pptxSKUP1
 
DATA STRUCTURES AND LINKED LISTS IN C.pptx
DATA STRUCTURES AND LINKED LISTS IN C.pptxDATA STRUCTURES AND LINKED LISTS IN C.pptx
DATA STRUCTURES AND LINKED LISTS IN C.pptxLECO9
 
linked list using c
linked list using clinked list using c
linked list using cVenkat Reddy
 
Introduction to linked lists
Introduction to linked listsIntroduction to linked lists
Introduction to linked listspooja kumari
 
ds-lecture-4-171012041008 (1).pdf
ds-lecture-4-171012041008 (1).pdfds-lecture-4-171012041008 (1).pdf
ds-lecture-4-171012041008 (1).pdfKamranAli649587
 
Linked List.pptx
Linked List.pptxLinked List.pptx
Linked List.pptxSherinRappai
 
Data Structures and Algorithms - Lec 05.pptx
Data Structures and Algorithms - Lec 05.pptxData Structures and Algorithms - Lec 05.pptx
Data Structures and Algorithms - Lec 05.pptxRameshaFernando2
 
linked list in data structure
linked list in data structure linked list in data structure
linked list in data structure shameen khan
 
2- link-list.ppt
2- link-list.ppt2- link-list.ppt
2- link-list.pptzabihniazai1
 
Linked List
Linked ListLinked List
Linked ListRaaviKapoor
 
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 KristinaBorooah
 
LinkedList Presentation.pptx
LinkedList Presentation.pptxLinkedList Presentation.pptx
LinkedList Presentation.pptxwahid431192
 

Similar to Link_List.pptx (20)

data structures and applications power p
data structures and applications power pdata structures and applications power p
data structures and applications power p
 
DATA STRUCTURES AND LINKED LISTS IN C.pptx
DATA STRUCTURES AND LINKED LISTS IN C.pptxDATA STRUCTURES AND LINKED LISTS IN C.pptx
DATA STRUCTURES AND LINKED LISTS IN C.pptx
 
DATA STRUCTURES AND LINKED LISTS IN C.pptx
DATA STRUCTURES AND LINKED LISTS IN C.pptxDATA STRUCTURES AND LINKED LISTS IN C.pptx
DATA STRUCTURES AND LINKED LISTS IN C.pptx
 
Linked list
Linked listLinked list
Linked list
 
linked list using c
linked list using clinked list using c
linked list using c
 
Introduction to linked lists
Introduction to linked listsIntroduction to linked lists
Introduction to linked lists
 
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.pptx
Linked List.pptxLinked List.pptx
Linked List.pptx
 
Linked list (1).pptx
Linked list (1).pptxLinked list (1).pptx
Linked list (1).pptx
 
Data Structures and Algorithms - Lec 05.pptx
Data Structures and Algorithms - Lec 05.pptxData Structures and Algorithms - Lec 05.pptx
Data Structures and Algorithms - Lec 05.pptx
 
linked list in data structure
linked list in data structure linked list in data structure
linked list in data structure
 
Linked lists
Linked listsLinked lists
Linked lists
 
2- link-list.ppt
2- link-list.ppt2- link-list.ppt
2- link-list.ppt
 
Data structures2
Data structures2Data structures2
Data structures2
 
Linked List
Linked ListLinked List
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
 
unit 1.pptx
unit 1.pptxunit 1.pptx
unit 1.pptx
 
Linked List
Linked ListLinked List
Linked List
 
LinkedList Presentation.pptx
LinkedList Presentation.pptxLinkedList Presentation.pptx
LinkedList Presentation.pptx
 
Sy ds -I
Sy ds -ISy ds -I
Sy ds -I
 

More from sandeep54552

Dijkstra Searching Algorithms Shortest.pptx
Dijkstra Searching Algorithms Shortest.pptxDijkstra Searching Algorithms Shortest.pptx
Dijkstra Searching Algorithms Shortest.pptxsandeep54552
 
E_R-Diagram (2).pptx
E_R-Diagram (2).pptxE_R-Diagram (2).pptx
E_R-Diagram (2).pptxsandeep54552
 
Dijkstra Searching Algorithms.pptx
Dijkstra Searching Algorithms.pptxDijkstra Searching Algorithms.pptx
Dijkstra Searching Algorithms.pptxsandeep54552
 
Agents_AI.ppt
Agents_AI.pptAgents_AI.ppt
Agents_AI.pptsandeep54552
 
Heap_Sort1.pptx
Heap_Sort1.pptxHeap_Sort1.pptx
Heap_Sort1.pptxsandeep54552
 
Templates in c++
Templates in c++Templates in c++
Templates in c++sandeep54552
 
File handling in c++
File handling in c++File handling in c++
File handling in c++sandeep54552
 
Exception handling in c++
Exception handling in c++Exception handling in c++
Exception handling in c++sandeep54552
 
Inheritance in c++
Inheritance in c++ Inheritance in c++
Inheritance in c++ sandeep54552
 
Constructor and Destructors in C++
Constructor and Destructors in C++Constructor and Destructors in C++
Constructor and Destructors in C++sandeep54552
 
C++ programming introduction
C++ programming introductionC++ programming introduction
C++ programming introductionsandeep54552
 
Jsp tag library
Jsp tag libraryJsp tag library
Jsp tag librarysandeep54552
 
Hill climbing algorithm in artificial intelligence
Hill climbing algorithm in artificial intelligenceHill climbing algorithm in artificial intelligence
Hill climbing algorithm in artificial intelligencesandeep54552
 
Session bean
Session beanSession bean
Session beansandeep54552
 
Greedy algorithms
Greedy algorithmsGreedy algorithms
Greedy algorithmssandeep54552
 
A star algorithms
A star algorithmsA star algorithms
A star algorithmssandeep54552
 
Enterprise java unit-3_chapter-1-jsp
Enterprise  java unit-3_chapter-1-jspEnterprise  java unit-3_chapter-1-jsp
Enterprise java unit-3_chapter-1-jspsandeep54552
 

More from sandeep54552 (20)

Dijkstra Searching Algorithms Shortest.pptx
Dijkstra Searching Algorithms Shortest.pptxDijkstra Searching Algorithms Shortest.pptx
Dijkstra Searching Algorithms Shortest.pptx
 
E_R-Diagram (2).pptx
E_R-Diagram (2).pptxE_R-Diagram (2).pptx
E_R-Diagram (2).pptx
 
Dijkstra Searching Algorithms.pptx
Dijkstra Searching Algorithms.pptxDijkstra Searching Algorithms.pptx
Dijkstra Searching Algorithms.pptx
 
Agents_AI.ppt
Agents_AI.pptAgents_AI.ppt
Agents_AI.ppt
 
Heap_Sort1.pptx
Heap_Sort1.pptxHeap_Sort1.pptx
Heap_Sort1.pptx
 
Templates in c++
Templates in c++Templates in c++
Templates in c++
 
File handling in c++
File handling in c++File handling in c++
File handling in c++
 
Exception handling in c++
Exception handling in c++Exception handling in c++
Exception handling in c++
 
Inheritance in c++
Inheritance in c++ Inheritance in c++
Inheritance in c++
 
Constructor and Destructors in C++
Constructor and Destructors in C++Constructor and Destructors in C++
Constructor and Destructors in C++
 
C++ programming introduction
C++ programming introductionC++ programming introduction
C++ programming introduction
 
Jsp tag library
Jsp tag libraryJsp tag library
Jsp tag library
 
Hill climbing algorithm in artificial intelligence
Hill climbing algorithm in artificial intelligenceHill climbing algorithm in artificial intelligence
Hill climbing algorithm in artificial intelligence
 
Session bean
Session beanSession bean
Session bean
 
Greedy algorithms
Greedy algorithmsGreedy algorithms
Greedy algorithms
 
A star algorithms
A star algorithmsA star algorithms
A star algorithms
 
Bfs new
Bfs newBfs new
Bfs new
 
Bfs new
Bfs newBfs new
Bfs new
 
Jdbc ppt
Jdbc pptJdbc ppt
Jdbc ppt
 
Enterprise java unit-3_chapter-1-jsp
Enterprise  java unit-3_chapter-1-jspEnterprise  java unit-3_chapter-1-jsp
Enterprise java unit-3_chapter-1-jsp
 

Recently uploaded

Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...Pooja Nehwal
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 

Recently uploaded (20)

Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 

Link_List.pptx

  • 2. Linked List • Linked List can be defined as collection of objects called nodes that are randomly stored in the memory. • A node contains two fields i.e. data stored at that particular address and the pointer which contains the address of the next node in the memory. • The last node of the list contains pointer to the null.
  • 3. Each node holds its own data and the address of the next node hence forming a chain like structure. Linked Lists are used to create trees and graphs.
  • 4. Types of Link List Following are the types of linked list • Singly Linked List. • Doubly Linked List. • Circular Linked List.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15. Insertion of node at particular position
  • 16.
  • 17.
  • 18. Deleting node at Beginning of Link List
  • 19.
  • 20. Deletion of node at the End of Link List
  • 21. Deletion of node at the End of Link List
  • 22.
  • 23. Deleting a particular node from Link List
  • 24.
  • 27. Copying a Link List into other Link List
  • 29. Doubly Linked List • A Doubly Linked List contains an extra memory to store the address of the previous node, together with the address of the next node and data which are there in the singly linked list. So, here we are storing the address of the next as well as the previous nodes. • The following is the structure of the node in the Doubly Linked List(DLL):
  • 30.
  • 31.
  • 32. Operations Performed on Two way Link List • Traversing • Searching • Insertion • Deletion
  • 33. Traversing Two Way Link List Two way link list can be traversed in both the directions i.e. in forward direction as well as backward direction.
  • 34. Searching Two Way Link List • Traverse the list until the pointer becomes null. Keep shifting pointer to its next and increasing by +1. • Compare each element of the list with the item which is to be searched. • If the item matched with any node value then the location of that value I will be returned from the function else NULL is returned.
  • 35. Insertion of node in Two way Link List There are three cases while inserting node • Insertion at the Beginning • Insertion at the End • Insertion at the Particular position
  • 36. Inserting the node at the Beginning
  • 37. Inserting the node at the End
  • 38. Inserting the node at particular position
  • 39.
  • 40.
  • 41. Deleting Node at Particular Position Two Way Link List
  • 42.
  • 43. Deleting Last Node in Two Way Link List
  • 44.
  • 45. Circular Link List All Circular linked list is a list in which last node points back to the first node instead of containing the Null pointer in the next part of the last node.
  • 46.
  • 47.
  • 48. Circular Singly Linked List In a circular Singly linked list, the last node of the list contains a pointer to the first node of the list. We can have circular singly linked list as well as circular doubly linked list. We traverse a circular singly linked list until we reach the same node where we started. The circular singly liked list has no beginning and no ending. There is no null value present in the next part of any of the nodes.
  • 49. Operations on circular singly linked list SN Operation Description 1 Insertion at beginning Adding a node in circular singly linked list at the beginning. 2 Insertion at end Adding a node in circular singly linked list at the end. 3 Deletion at beginning Removing a node in circular singly linked list from beginning. 4 Deletion at end Removing a node in circular singly linked list at the end. 5 Traversing Visiting each element of the list at least once in order to perform some specific operation.
  • 50. Circular Doubly Linked List Circular doubly linked list is a more complexed type of data structure in which a node contain pointers to its previous node as well as the next node. Circular doubly linked list doesn't contain NULL in any of the node. The last node of the list contains the address of the first node of the list. The first node of the list also contain address of the last node in its previous pointer.
  • 51. Operations on circular doubly linked list : SN Operation Description 1 Insertion at beginning Adding a node in circular doubly linked list at the beginning. 2 Insertion at end Adding a node in circular doubly linked list at the end. 3 Deletion at beginning Removing a node in circular doubly linked list from beginning. 4 Deletion at end Removing a node in circular doubly linked list at the end.
  • 52. Advantages of a Circular linked list • The list can be traversed from any node. • Circular lists are the required data structure when we want a list to be accessed in a circle or loop. • We can easily traverse to its previous node in a circular linked list, which is not possible in a singly linked list.
  • 53. Disadvantages of Circular linked list • If not traversed carefully, then we could end up in an infinite loop because here we don't have any NULL value to stop the traversal. • Operations in a circular linked list are complex as compared to a singly linked list and doubly linked list.