SlideShare a Scribd company logo
Dr. C. Saritha
Lecturer in Electronics
SSBN Degree & PG College
ANANTAPUR
 Data structure:-A data structure is a
logical representation of data and
operation that can be performed on
the data.
1)linear data structure
2)Non linear data structure
 Linear data structure is an order of
data elements. They are arrays,
stacks, queues, and linked lists.
Linked list :- linked list is a linear data
structure. It contains nodes. Each node
contains two parts, i.e. DATA part and
LINK part.
 The data contains elements and
 Link contains address of another node.
 Arrays are simple to understand and
elements of an array are easily
accessible
 But arrays have some limitations.
 Arrays have a fixed dimension.
 Once the size of an array is decided it
can not be increased or decreased
during education.
 Array elements are always stored in
contiguous memory locations.
 Operations like insertion or deletion of
the array are pretty tedious.
 To over come this limitations we use
linked list.
 Linked list is a collection of elements
called nodes.
 Each node contains two parts. they are
data part and link part.
Node
data link
200 100 400
• 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
The basic operations on linked lists are
1. Creation
2. Insertion
3. Deletion
4. Traversing
5. Searching
6. Concatenation
7. Display
• The creation operation is used to create
a linked list.
• Insertion operation is used to insert a
new node in the linked list at the
specified position. A new node may be
inserted at the beginning of a linked
list , at the end of the linked list , at the
specified position in a linked list. If the
list itself is empty , then the new node
is inserted as a first node.
• Deletion operation is used to delete on
item from the linked list. It may be
deleted from the beginning of a linked
list , specified position in the list.
• 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.
• If the traversal start from the last node
towards the first node , it is called back
word 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.
• Concatenation operation is the process
of appending the second list to the end
of the first list. When we concatenate
two lists , the resultant list becomes
larger in size.
• The display operation is used to print
each and every node’s information.
1. Single linked list
2. Double linked list
3. Circular linked list
4. Circular double linked list
SINGLE LINKED LIST :-
• A single linked list is one in which all
nodes are linked together in some
sequential manner.
• CIRCULAR LINKED LIST :-
• A circular linked list is one which has
no beginning and no ending. The null
pointer in the last node of a linked list
is replaced with the address of its first
node such a list is called circular linked
list.
SINGLE LINKED LIST :
Start
CIRCULAR LINKED LIST:-
400 100 200
35 N60 20045 100
60 200 35 40045 100
500
 In circular linked list we have
three functions. They are
• addcirq( )
• delcirq( )
• cirq_display( )
addcirq( ) :-
This function accepts three
parameters.
 First parameter receives the address
of the first node.
 The second parameter receives the
address of the pointer to the last
node.
Delcirq( ) :-
This function receives two parameters.
 The first parameter is the pointer to the
front node.
 The second is the pointer to the rear.
front rear10 51617
REVERSING THE LINKS :
Reversing means the last node
becomes the first node and the first
becomes the last.
5 17 N323
17323
5 N23317
5
MERGING OF LINKED LIST :
• suppose we have two linked lists.
• That are pointed to two independent
pointers. We have to merge the two
links into a third list.
• By using this merge ( ) to ensure that
those elements which are common to
both the lists occur only once in the
third list.
9 12 14 N
12 17 24 N
9 12 14 17 24 N
SORTING OF A LINKED LIST :
• Sorting means to arrange the elements
either in ascending or descending
order.
• To sort the elements of a linked list we
use any of the standard sorting
algorithms for carrying out the sorting.
• While performing the sorting, when it
is time to exchange two elements, we
can adopt any of the following two
strategies.
1)Exchange the data part of the two
nodes, keeping the links intact.
8 N432
3 N482
2) Keep the data in the nodes intact.
Simply readjust the links such that
effectively the order of the nodes
changes
200 400 500 600
200 400 500 600
11 N4 4008 6002 500
11 N4 6008 5002 400
RECURSIVE OPERATIONS ON
LINKED LIST :
 A function called by itself known as
recursion.
 If a statement within the body of a
function calls the same function.
 Some of the operations that are carried
out on linked list can be easily
implemented using recursion.
 For example finding out the number
of nodes present in a linked list,
comparing two lists, copying one
linked list into another, adding a new
node at the end of the linked list, etc.,
 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.
 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
 Linked lists are used in many other
data structures.
 Linked lists are used in polynomial
manipulation.
 Representation of trees, stacks, queues.
etc.,
THANK YOU

More Related Content

What's hot

Doubly Linked List || Operations || Algorithms
Doubly Linked List || Operations || AlgorithmsDoubly Linked List || Operations || Algorithms
Doubly Linked List || Operations || Algorithms
Shubham Sharma
 
Linked lists
Linked listsLinked lists
Linked lists
SARITHA REDDY
 
Minimum spanning tree
Minimum spanning treeMinimum spanning tree
Minimum spanning tree
Hinal Lunagariya
 
BINARY SEARCH TREE
BINARY SEARCH TREEBINARY SEARCH TREE
BINARY SEARCH TREE
ER Punit Jain
 
Binary Search Tree
Binary Search TreeBinary Search Tree
Binary Search Tree
sagar yadav
 
Linked List
Linked ListLinked List
Linked List
RaaviKapoor
 
B and B+ tree
B and B+ treeB and B+ tree
B and B+ tree
Ashish Arun
 
Binary Search Tree
Binary Search TreeBinary Search Tree
Stack
StackStack
Searching and Sorting Techniques in Data Structure
Searching and Sorting Techniques in Data StructureSearching and Sorting Techniques in Data Structure
Searching and Sorting Techniques in Data Structure
Balwant Gorad
 
Spanning trees
Spanning treesSpanning trees
Spanning trees
Shareb Ismaeel
 
Double link list
Double link listDouble link list
Double link list
Amber Wajid
 
python project ppt.pptx
python project ppt.pptxpython project ppt.pptx
python project ppt.pptx
AkshatGoswami3
 
Python list
Python listPython list
stacks and queues
stacks and queuesstacks and queues
stacks and queues
DurgaDeviCbit
 
Doubly Linked List
Doubly Linked ListDoubly Linked List
Doubly Linked List
Ninad Mankar
 
Supply and Demand
Supply and DemandSupply and Demand
Supply and Demand
amckean
 
Trigger
TriggerTrigger
B trees
B treesB trees
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
Afzal Badshah
 

What's hot (20)

Doubly Linked List || Operations || Algorithms
Doubly Linked List || Operations || AlgorithmsDoubly Linked List || Operations || Algorithms
Doubly Linked List || Operations || Algorithms
 
Linked lists
Linked listsLinked lists
Linked lists
 
Minimum spanning tree
Minimum spanning treeMinimum spanning tree
Minimum spanning tree
 
BINARY SEARCH TREE
BINARY SEARCH TREEBINARY SEARCH TREE
BINARY SEARCH TREE
 
Binary Search Tree
Binary Search TreeBinary Search Tree
Binary Search Tree
 
Linked List
Linked ListLinked List
Linked List
 
B and B+ tree
B and B+ treeB and B+ tree
B and B+ tree
 
Binary Search Tree
Binary Search TreeBinary Search Tree
Binary Search Tree
 
Stack
StackStack
Stack
 
Searching and Sorting Techniques in Data Structure
Searching and Sorting Techniques in Data StructureSearching and Sorting Techniques in Data Structure
Searching and Sorting Techniques in Data Structure
 
Spanning trees
Spanning treesSpanning trees
Spanning trees
 
Double link list
Double link listDouble link list
Double link list
 
python project ppt.pptx
python project ppt.pptxpython project ppt.pptx
python project ppt.pptx
 
Python list
Python listPython list
Python list
 
stacks and queues
stacks and queuesstacks and queues
stacks and queues
 
Doubly Linked List
Doubly Linked ListDoubly Linked List
Doubly Linked List
 
Supply and Demand
Supply and DemandSupply and Demand
Supply and Demand
 
Trigger
TriggerTrigger
Trigger
 
B trees
B treesB trees
B trees
 
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
 

Viewers also liked

Linkedlist1
Linkedlist1Linkedlist1
Linkedlist1
Rajendran
 
mechanizing reasoning
mechanizing reasoningmechanizing reasoning
mechanizing reasoning
Rajendran
 
orders of_growth
orders of_growthorders of_growth
orders of_growth
Rajendran
 
List moderate
List   moderateList   moderate
List moderate
Rajendran
 
Basics & asymptotic notations
Basics & asymptotic notationsBasics & asymptotic notations
Basics & asymptotic notations
Rajendran
 
StackArray stack3
StackArray stack3StackArray stack3
StackArray stack3
Rajendran
 
Vector3
Vector3Vector3
Vector3
Rajendran
 
Turing Machine
Turing MachineTuring Machine
Turing Machine
Rajendran
 
proving non-computability
proving non-computabilityproving non-computability
proving non-computability
Rajendran
 
Variants of Turing Machine
Variants of Turing MachineVariants of Turing Machine
Variants of Turing Machine
Rajendran
 
Array stack-queue1
Array stack-queue1Array stack-queue1
Array stack-queue1
Rajendran
 
3.1 intro toautomatatheory h1
3.1 intro toautomatatheory  h13.1 intro toautomatatheory  h1
3.1 intro toautomatatheory h1
Rajendran
 
Glare
GlareGlare
Glare
Rajendran
 
Predicate calculus
Predicate calculusPredicate calculus
Predicate calculus
Rajendran
 
Basic terminologies & asymptotic notations
Basic terminologies & asymptotic notationsBasic terminologies & asymptotic notations
Basic terminologies & asymptotic notations
Rajendran
 
Binary tree
Binary tree Binary tree
Binary tree
Rajendran
 
Greedy method1
Greedy method1Greedy method1
Greedy method1
Rajendran
 
Basic terminologies
Basic terminologiesBasic terminologies
Basic terminologies
Rajendran
 
Splay tree
Splay treeSplay tree
Splay tree
Rajendran
 

Viewers also liked (19)

Linkedlist1
Linkedlist1Linkedlist1
Linkedlist1
 
mechanizing reasoning
mechanizing reasoningmechanizing reasoning
mechanizing reasoning
 
orders of_growth
orders of_growthorders of_growth
orders of_growth
 
List moderate
List   moderateList   moderate
List moderate
 
Basics & asymptotic notations
Basics & asymptotic notationsBasics & asymptotic notations
Basics & asymptotic notations
 
StackArray stack3
StackArray stack3StackArray stack3
StackArray stack3
 
Vector3
Vector3Vector3
Vector3
 
Turing Machine
Turing MachineTuring Machine
Turing Machine
 
proving non-computability
proving non-computabilityproving non-computability
proving non-computability
 
Variants of Turing Machine
Variants of Turing MachineVariants of Turing Machine
Variants of Turing Machine
 
Array stack-queue1
Array stack-queue1Array stack-queue1
Array stack-queue1
 
3.1 intro toautomatatheory h1
3.1 intro toautomatatheory  h13.1 intro toautomatatheory  h1
3.1 intro toautomatatheory h1
 
Glare
GlareGlare
Glare
 
Predicate calculus
Predicate calculusPredicate calculus
Predicate calculus
 
Basic terminologies & asymptotic notations
Basic terminologies & asymptotic notationsBasic terminologies & asymptotic notations
Basic terminologies & asymptotic notations
 
Binary tree
Binary tree Binary tree
Binary tree
 
Greedy method1
Greedy method1Greedy method1
Greedy method1
 
Basic terminologies
Basic terminologiesBasic terminologies
Basic terminologies
 
Splay tree
Splay treeSplay tree
Splay tree
 

Similar to Linkedlists

Linked list (1).pptx
Linked list (1).pptxLinked list (1).pptx
Linked list (1).pptx
rajveersingh643731
 
linked list in data structure
linked list in data structure linked list in data structure
linked list in data structure
shameen khan
 
ds-lecture-4-171012041008 (1).pdf
ds-lecture-4-171012041008 (1).pdfds-lecture-4-171012041008 (1).pdf
ds-lecture-4-171012041008 (1).pdf
KamranAli649587
 
data structures and applications power p
data structures and applications power pdata structures and applications power p
data structures and applications power p
MeghaKulkarni27
 
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
 
Linked list
Linked listLinked list
Linked list
MahammadAdil
 
1.3 Linked List.pptx
1.3 Linked List.pptx1.3 Linked List.pptx
1.3 Linked List.pptx
ssuserd2f031
 
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
RameshaFernando2
 
Linked List
Linked ListLinked List
Linked List
BHARATH KUMAR
 
unit 1.pptx
unit 1.pptxunit 1.pptx
unit 1.pptx
ssuser7922b8
 
Linkedlist
LinkedlistLinkedlist
csc211_lecture_21.pptx
csc211_lecture_21.pptxcsc211_lecture_21.pptx
csc211_lecture_21.pptx
ASADAHMAD811380
 
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
SKUP1
 
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
LECO9
 
Linked list (introduction) 1
Linked list (introduction) 1Linked list (introduction) 1
Linked list (introduction) 1
DrSudeshna
 
02. the linked lists (1)
02. the linked lists (1)02. the linked lists (1)
02. the linked lists (1)
ረዳኢ በሪሁ
 
Unit 3 dsa LINKED LIST
Unit 3 dsa LINKED LISTUnit 3 dsa LINKED LIST
Link list
Link listLink list
Link list
Didar Rashad
 
Link list
Link listLink list
Link list
Didar Rashad
 
linked list using c
linked list using clinked list using c
linked list using c
Venkat Reddy
 

Similar to Linkedlists (20)

Linked list (1).pptx
Linked list (1).pptxLinked list (1).pptx
Linked list (1).pptx
 
linked list in data structure
linked list in data structure linked list in data structure
linked list in data structure
 
ds-lecture-4-171012041008 (1).pdf
ds-lecture-4-171012041008 (1).pdfds-lecture-4-171012041008 (1).pdf
ds-lecture-4-171012041008 (1).pdf
 
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 and Algorithm
Linked list in Data Structure and Algorithm Linked list in Data Structure and Algorithm
Linked list in Data Structure and Algorithm
 
Linked list
Linked listLinked list
Linked list
 
1.3 Linked List.pptx
1.3 Linked List.pptx1.3 Linked List.pptx
1.3 Linked List.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
Linked ListLinked List
Linked List
 
unit 1.pptx
unit 1.pptxunit 1.pptx
unit 1.pptx
 
Linkedlist
LinkedlistLinkedlist
Linkedlist
 
csc211_lecture_21.pptx
csc211_lecture_21.pptxcsc211_lecture_21.pptx
csc211_lecture_21.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
 
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 (introduction) 1
Linked list (introduction) 1Linked list (introduction) 1
Linked list (introduction) 1
 
02. the linked lists (1)
02. the linked lists (1)02. the linked lists (1)
02. the linked lists (1)
 
Unit 3 dsa LINKED LIST
Unit 3 dsa LINKED LISTUnit 3 dsa LINKED LIST
Unit 3 dsa LINKED LIST
 
Link list
Link listLink list
Link list
 
Link list
Link listLink list
Link list
 
linked list using c
linked list using clinked list using c
linked list using c
 

More from Rajendran

Element distinctness lower bounds
Element distinctness lower boundsElement distinctness lower bounds
Element distinctness lower bounds
Rajendran
 
Scheduling with Startup and Holding Costs
Scheduling with Startup and Holding CostsScheduling with Startup and Holding Costs
Scheduling with Startup and Holding Costs
Rajendran
 
Divide and conquer surfing lower bounds
Divide and conquer  surfing lower boundsDivide and conquer  surfing lower bounds
Divide and conquer surfing lower bounds
Rajendran
 
Red black tree
Red black treeRed black tree
Red black tree
Rajendran
 
Hash table
Hash tableHash table
Hash table
Rajendran
 
Medians and order statistics
Medians and order statisticsMedians and order statistics
Medians and order statistics
Rajendran
 
Proof master theorem
Proof master theoremProof master theorem
Proof master theorem
Rajendran
 
Recursion tree method
Recursion tree methodRecursion tree method
Recursion tree method
Rajendran
 
Recurrence theorem
Recurrence theoremRecurrence theorem
Recurrence theorem
Rajendran
 
Master method
Master method Master method
Master method
Rajendran
 
Master method theorem
Master method theoremMaster method theorem
Master method theorem
Rajendran
 
Hash tables
Hash tablesHash tables
Hash tables
Rajendran
 
Lower bound
Lower boundLower bound
Lower bound
Rajendran
 
Master method theorem
Master method theoremMaster method theorem
Master method theorem
Rajendran
 
Greedy algorithms
Greedy algorithmsGreedy algorithms
Greedy algorithms
Rajendran
 
Longest common subsequences in Algorithm Analysis
Longest common subsequences in Algorithm AnalysisLongest common subsequences in Algorithm Analysis
Longest common subsequences in Algorithm Analysis
Rajendran
 
Dynamic programming in Algorithm Analysis
Dynamic programming in Algorithm AnalysisDynamic programming in Algorithm Analysis
Dynamic programming in Algorithm Analysis
Rajendran
 
Average case Analysis of Quicksort
Average case Analysis of QuicksortAverage case Analysis of Quicksort
Average case Analysis of Quicksort
Rajendran
 
Np completeness
Np completenessNp completeness
Np completeness
Rajendran
 
computer languages
computer languagescomputer languages
computer languages
Rajendran
 

More from Rajendran (20)

Element distinctness lower bounds
Element distinctness lower boundsElement distinctness lower bounds
Element distinctness lower bounds
 
Scheduling with Startup and Holding Costs
Scheduling with Startup and Holding CostsScheduling with Startup and Holding Costs
Scheduling with Startup and Holding Costs
 
Divide and conquer surfing lower bounds
Divide and conquer  surfing lower boundsDivide and conquer  surfing lower bounds
Divide and conquer surfing lower bounds
 
Red black tree
Red black treeRed black tree
Red black tree
 
Hash table
Hash tableHash table
Hash table
 
Medians and order statistics
Medians and order statisticsMedians and order statistics
Medians and order statistics
 
Proof master theorem
Proof master theoremProof master theorem
Proof master theorem
 
Recursion tree method
Recursion tree methodRecursion tree method
Recursion tree method
 
Recurrence theorem
Recurrence theoremRecurrence theorem
Recurrence theorem
 
Master method
Master method Master method
Master method
 
Master method theorem
Master method theoremMaster method theorem
Master method theorem
 
Hash tables
Hash tablesHash tables
Hash tables
 
Lower bound
Lower boundLower bound
Lower bound
 
Master method theorem
Master method theoremMaster method theorem
Master method theorem
 
Greedy algorithms
Greedy algorithmsGreedy algorithms
Greedy algorithms
 
Longest common subsequences in Algorithm Analysis
Longest common subsequences in Algorithm AnalysisLongest common subsequences in Algorithm Analysis
Longest common subsequences in Algorithm Analysis
 
Dynamic programming in Algorithm Analysis
Dynamic programming in Algorithm AnalysisDynamic programming in Algorithm Analysis
Dynamic programming in Algorithm Analysis
 
Average case Analysis of Quicksort
Average case Analysis of QuicksortAverage case Analysis of Quicksort
Average case Analysis of Quicksort
 
Np completeness
Np completenessNp completeness
Np completeness
 
computer languages
computer languagescomputer languages
computer languages
 

Recently uploaded

คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
สมใจ จันสุกสี
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Excellence Foundation for South Sudan
 
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem studentsRHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
Himanshu Rai
 
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
Nguyen Thanh Tu Collection
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
PECB
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
Nguyen Thanh Tu Collection
 
IGCSE Biology Chapter 14- Reproduction in Plants.pdf
IGCSE Biology Chapter 14- Reproduction in Plants.pdfIGCSE Biology Chapter 14- Reproduction in Plants.pdf
IGCSE Biology Chapter 14- Reproduction in Plants.pdf
Amin Marwan
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
adhitya5119
 
How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience
Wahiba Chair Training & Consulting
 
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptxNEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
iammrhaywood
 
Walmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdfWalmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdf
TechSoup
 
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptxBeyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
EduSkills OECD
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
Jean Carlos Nunes Paixão
 
How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
Celine George
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
Dr. Mulla Adam Ali
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
heathfieldcps1
 
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skillsspot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
haiqairshad
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
Priyankaranawat4
 
BBR 2024 Summer Sessions Interview Training
BBR  2024 Summer Sessions Interview TrainingBBR  2024 Summer Sessions Interview Training
BBR 2024 Summer Sessions Interview Training
Katrina Pritchard
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
History of Stoke Newington
 

Recently uploaded (20)

คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
 
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem studentsRHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
 
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
 
IGCSE Biology Chapter 14- Reproduction in Plants.pdf
IGCSE Biology Chapter 14- Reproduction in Plants.pdfIGCSE Biology Chapter 14- Reproduction in Plants.pdf
IGCSE Biology Chapter 14- Reproduction in Plants.pdf
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
 
How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience
 
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptxNEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
 
Walmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdfWalmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdf
 
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptxBeyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
 
How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
 
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skillsspot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
 
BBR 2024 Summer Sessions Interview Training
BBR  2024 Summer Sessions Interview TrainingBBR  2024 Summer Sessions Interview Training
BBR 2024 Summer Sessions Interview Training
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
 

Linkedlists

  • 1. Dr. C. Saritha Lecturer in Electronics SSBN Degree & PG College ANANTAPUR
  • 2.  Data structure:-A data structure is a logical representation of data and operation that can be performed on the data. 1)linear data structure 2)Non linear data structure  Linear data structure is an order of data elements. They are arrays, stacks, queues, and linked lists.
  • 3. Linked list :- linked list is a linear data structure. It contains nodes. Each node contains two parts, i.e. DATA part and LINK part.  The data contains elements and  Link contains address of another node.
  • 4.  Arrays are simple to understand and elements of an array are easily accessible  But arrays have some limitations.  Arrays have a fixed dimension.  Once the size of an array is decided it can not be increased or decreased during education.
  • 5.  Array elements are always stored in contiguous memory locations.  Operations like insertion or deletion of the array are pretty tedious.  To over come this limitations we use linked list.
  • 6.  Linked list is a collection of elements called nodes.  Each node contains two parts. they are data part and link part. Node data link
  • 7. 200 100 400 • 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
  • 8. The basic operations on linked lists are 1. Creation 2. Insertion 3. Deletion 4. Traversing 5. Searching 6. Concatenation 7. Display
  • 9. • The creation operation is used to create a linked list. • Insertion operation is used to insert a new node in the linked list at the specified position. A new node may be inserted at the beginning of a linked list , at the end of the linked list , at the specified position in a linked list. If the list itself is empty , then the new node is inserted as a first node.
  • 10. • Deletion operation is used to delete on item from the linked list. It may be deleted from the beginning of a linked list , specified position in the list. • 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.
  • 11. • If the traversal start from the last node towards the first node , it is called back word 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.
  • 12. • Concatenation operation is the process of appending the second list to the end of the first list. When we concatenate two lists , the resultant list becomes larger in size. • The display operation is used to print each and every node’s information.
  • 13. 1. Single linked list 2. Double linked list 3. Circular linked list 4. Circular double linked list
  • 14. SINGLE LINKED LIST :- • A single linked list is one in which all nodes are linked together in some sequential manner. • CIRCULAR LINKED LIST :- • A circular linked list is one which has no beginning and no ending. The null pointer in the last node of a linked list is replaced with the address of its first node such a list is called circular linked list.
  • 15. SINGLE LINKED LIST : Start CIRCULAR LINKED LIST:- 400 100 200 35 N60 20045 100 60 200 35 40045 100 500
  • 16.  In circular linked list we have three functions. They are • addcirq( ) • delcirq( ) • cirq_display( )
  • 17. addcirq( ) :- This function accepts three parameters.  First parameter receives the address of the first node.  The second parameter receives the address of the pointer to the last node.
  • 18. Delcirq( ) :- This function receives two parameters.  The first parameter is the pointer to the front node.  The second is the pointer to the rear. front rear10 51617
  • 19. REVERSING THE LINKS : Reversing means the last node becomes the first node and the first becomes the last. 5 17 N323 17323 5 N23317 5
  • 20. MERGING OF LINKED LIST : • suppose we have two linked lists. • That are pointed to two independent pointers. We have to merge the two links into a third list. • By using this merge ( ) to ensure that those elements which are common to both the lists occur only once in the third list.
  • 21. 9 12 14 N 12 17 24 N 9 12 14 17 24 N
  • 22. SORTING OF A LINKED LIST : • Sorting means to arrange the elements either in ascending or descending order. • To sort the elements of a linked list we use any of the standard sorting algorithms for carrying out the sorting. • While performing the sorting, when it is time to exchange two elements, we can adopt any of the following two strategies.
  • 23. 1)Exchange the data part of the two nodes, keeping the links intact. 8 N432 3 N482
  • 24. 2) Keep the data in the nodes intact. Simply readjust the links such that effectively the order of the nodes changes 200 400 500 600 200 400 500 600 11 N4 4008 6002 500 11 N4 6008 5002 400
  • 25. RECURSIVE OPERATIONS ON LINKED LIST :  A function called by itself known as recursion.  If a statement within the body of a function calls the same function.  Some of the operations that are carried out on linked list can be easily implemented using recursion.
  • 26.  For example finding out the number of nodes present in a linked list, comparing two lists, copying one linked list into another, adding a new node at the end of the linked list, etc.,
  • 27.  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.
  • 28.  Operation like insertion or deletion are less time consuming.  Linked lists provide flexibility in allowing the items to be arranged efficiently.
  • 29.  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
  • 30.  Linked lists are used in many other data structures.  Linked lists are used in polynomial manipulation.  Representation of trees, stacks, queues. etc.,