SlideShare a Scribd company logo
1 of 14
Link List
• Arrangement of data in memory
• There are different ways to arrange data in
memory ,
• Array store data sequentially and in cotigious
memory locations that is not either possible nor
efficient in large computer system as
– There should not be enough memory , but there may be
enough blocks
– Array is static data structure
– Access is slow
• To overcome these problems we use link list
What is link list
– linked list is a data structure that consists of
a sequence of data records such that in each
record there is a field that contains a
reference (i.e., a link) to the next record in the
sequence.
– In link list data is arrange in records
• Each record is called node
• Data item may be store anywhere in memory
• Each node consist of data and pointer to next item
• Mean the items are connected logically
Advantages of link list
• Dynamically allocated data structures can
be linked together to form a chain.
• A linked list is a series of connected
nodes (or links) where each node is a
data structure.
• A linked list can grow or shrink in size as
the program runs.
• because the nodes in a linked list are dynamically
allocated.
Single link list
– Singular link list
• Linear collection of data items
• Visiting the elements be from start side to end side
• Y this is called one way link list
• Each node consist of two nodes ,first contain data
and the second contain the pointer to next
• The last node consist pointer NULL while start
variable contain address of first element ,it is also
called list pointer variable
Link list
Link list operations
• The important operations are
• Traversing
– It is visited form start to end when NULL occur ,so visiting
each element is called traversing
• Insertion
– How to insert a new item in list , at beginning ,at the End
, and it Middle
• Deletion
– How to Delete an item in list , at beginning ,at the End ,
and it Middle
• Searching
– To search for an item in the list.
• Sorting
– So sort the elements in an order…
Representation in Memory
• The items of link list are stored in memory in
scattered form but these are linked through
pointers
• Each item is called an object ,while each object
contain at least two fields ,one for to store the data
while other one is for next node address
Circular link list
• A link list in which the last node of the list
points back to the first node of the list is
called circular link list
Double Link list
• A list in which each node has the address
both of next and previous node is called
Double Link list
• It can be visited in both directions
• In singular list we can’t go back from current node
to previous node .while we can in double l.list
• Its also called two way list
• Each node consist of three field
• One store the data
• 2nd store the address of previous node
• 3rd store the address of next node
Double Link list operations
• The important operations are
• Traversing
– It is visited form start to end when NULL occur ,so visiting each
element is called traversing ,we do in both directions
• Insertion
– How to insert a new item in list , at beginning ,at the End , and it
Middle
• Deletion
– How to Delete an item in list , at beginning ,at the End , and it
Middle
• Searching
– To search for an item in the list as array
• Sorting
– So sort the elements in an order…
• Operation Name Description
• createList() Create a new list (presumably empty)
• copy() Set one list to be a copy of another
• clear(); Clear a list (remove all elements)
• insert(X, ?) Insert element X at a particular position in the list
• remove(?) Remove element at some position in the list
• get(?) Get element at a given position
• update(X, ?) Replace the element at a given position with X
• find(X) Determine if the element X is in the list
• length() Returns the length of the list.
• Functions Description
• start() Moves the “current” pointer to the very first element
• tail() Moves the “current” pointer to the very last element
• next() Move the current position forward one element
• back() Move the current position backward one element
2- link-list.ppt

More Related Content

Similar to 2- link-list.ppt

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
 
data structures and applications power p
data structures and applications power pdata structures and applications power p
data structures and applications power pMeghaKulkarni27
 
linked list in data structure
linked list in data structure linked list in data structure
linked list in data structure shameen khan
 
Different types of Linked list.
Different types of Linked list.Different types of Linked list.
Different types of Linked list.JAYANTAOJHA
 
Data structures and Algorithm analysis_Lecture 2.pptx
Data structures and Algorithm analysis_Lecture 2.pptxData structures and Algorithm analysis_Lecture 2.pptx
Data structures and Algorithm analysis_Lecture 2.pptxAhmedEldesoky24
 
1.Introduction to Data Structures and Algorithms.pptx
1.Introduction to Data Structures and Algorithms.pptx1.Introduction to Data Structures and Algorithms.pptx
1.Introduction to Data Structures and Algorithms.pptxBlueSwede
 
Singly Linked List
Singly Linked ListSingly Linked List
Singly Linked ListAtiya Akhtar
 
mbit_Unit-2_Linked List.pptx
mbit_Unit-2_Linked List.pptxmbit_Unit-2_Linked List.pptx
mbit_Unit-2_Linked List.pptxjotaro11
 

Similar to 2- link-list.ppt (20)

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
 
Data Structures 3
Data Structures 3Data Structures 3
Data Structures 3
 
Linked list (1).pptx
Linked list (1).pptxLinked list (1).pptx
Linked list (1).pptx
 
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
 
ds bridge.pptx
ds bridge.pptxds bridge.pptx
ds bridge.pptx
 
Data structures2
Data structures2Data structures2
Data structures2
 
Different types of Linked list.
Different types of Linked list.Different types of Linked list.
Different types of Linked list.
 
Data structures and Algorithm analysis_Lecture 2.pptx
Data structures and Algorithm analysis_Lecture 2.pptxData structures and Algorithm analysis_Lecture 2.pptx
Data structures and Algorithm analysis_Lecture 2.pptx
 
Link_List.pptx
Link_List.pptxLink_List.pptx
Link_List.pptx
 
Sy ds -I
Sy ds -ISy ds -I
Sy ds -I
 
Sy ds -I
Sy ds -ISy ds -I
Sy ds -I
 
Sy ds i
Sy ds iSy ds i
Sy ds i
 
linked list.pptx
linked list.pptxlinked list.pptx
linked list.pptx
 
1.Introduction to Data Structures and Algorithms.pptx
1.Introduction to Data Structures and Algorithms.pptx1.Introduction to Data Structures and Algorithms.pptx
1.Introduction to Data Structures and Algorithms.pptx
 
Linked List.pptx
Linked List.pptxLinked List.pptx
Linked List.pptx
 
Linked list ppt
Linked list pptLinked list ppt
Linked list ppt
 
Singly Linked List
Singly Linked ListSingly Linked List
Singly Linked List
 
mbit_Unit-2_Linked List.pptx
mbit_Unit-2_Linked List.pptxmbit_Unit-2_Linked List.pptx
mbit_Unit-2_Linked List.pptx
 
DSA - Copy.pptx
DSA - Copy.pptxDSA - Copy.pptx
DSA - Copy.pptx
 

Recently uploaded

Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% SecureCall me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% SecurePooja Nehwal
 
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
CebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptxCebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptxolyaivanovalion
 
Industrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdfIndustrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdfLars Albertsson
 
Mature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxMature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxolyaivanovalion
 
定制英国白金汉大学毕业证(UCB毕业证书) 成绩单原版一比一
定制英国白金汉大学毕业证(UCB毕业证书)																			成绩单原版一比一定制英国白金汉大学毕业证(UCB毕业证书)																			成绩单原版一比一
定制英国白金汉大学毕业证(UCB毕业证书) 成绩单原版一比一ffjhghh
 
BigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxBigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxolyaivanovalion
 
Invezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signalsInvezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signalsInvezz1
 
Smarteg dropshipping via API with DroFx.pptx
Smarteg dropshipping via API with DroFx.pptxSmarteg dropshipping via API with DroFx.pptx
Smarteg dropshipping via API with DroFx.pptxolyaivanovalion
 
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAl Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAroojKhan71
 
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service BhilaiLow Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service BhilaiSuhani Kapoor
 
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130Suhani Kapoor
 
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
Log Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptxLog Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptxJohnnyPlasten
 
RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998YohFuh
 
Halmar dropshipping via API with DroFx
Halmar  dropshipping  via API with DroFxHalmar  dropshipping  via API with DroFx
Halmar dropshipping via API with DroFxolyaivanovalion
 
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 

Recently uploaded (20)

Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% SecureCall me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
 
꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...
꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...
꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...
 
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
CebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptxCebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptx
 
Industrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdfIndustrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdf
 
Mature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxMature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptx
 
定制英国白金汉大学毕业证(UCB毕业证书) 成绩单原版一比一
定制英国白金汉大学毕业证(UCB毕业证书)																			成绩单原版一比一定制英国白金汉大学毕业证(UCB毕业证书)																			成绩单原版一比一
定制英国白金汉大学毕业证(UCB毕业证书) 成绩单原版一比一
 
BigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxBigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptx
 
Invezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signalsInvezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signals
 
VIP Call Girls Service Charbagh { Lucknow Call Girls Service 9548273370 } Boo...
VIP Call Girls Service Charbagh { Lucknow Call Girls Service 9548273370 } Boo...VIP Call Girls Service Charbagh { Lucknow Call Girls Service 9548273370 } Boo...
VIP Call Girls Service Charbagh { Lucknow Call Girls Service 9548273370 } Boo...
 
Smarteg dropshipping via API with DroFx.pptx
Smarteg dropshipping via API with DroFx.pptxSmarteg dropshipping via API with DroFx.pptx
Smarteg dropshipping via API with DroFx.pptx
 
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAl Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
 
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service BhilaiLow Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
 
Delhi 99530 vip 56974 Genuine Escort Service Call Girls in Kishangarh
Delhi 99530 vip 56974 Genuine Escort Service Call Girls in  KishangarhDelhi 99530 vip 56974 Genuine Escort Service Call Girls in  Kishangarh
Delhi 99530 vip 56974 Genuine Escort Service Call Girls in Kishangarh
 
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
 
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
 
Log Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptxLog Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptx
 
RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998
 
Halmar dropshipping via API with DroFx
Halmar  dropshipping  via API with DroFxHalmar  dropshipping  via API with DroFx
Halmar dropshipping via API with DroFx
 
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 

2- link-list.ppt

  • 1. Link List • Arrangement of data in memory • There are different ways to arrange data in memory , • Array store data sequentially and in cotigious memory locations that is not either possible nor efficient in large computer system as – There should not be enough memory , but there may be enough blocks – Array is static data structure – Access is slow • To overcome these problems we use link list
  • 2. What is link list – linked list is a data structure that consists of a sequence of data records such that in each record there is a field that contains a reference (i.e., a link) to the next record in the sequence. – In link list data is arrange in records • Each record is called node • Data item may be store anywhere in memory • Each node consist of data and pointer to next item • Mean the items are connected logically
  • 3. Advantages of link list • Dynamically allocated data structures can be linked together to form a chain. • A linked list is a series of connected nodes (or links) where each node is a data structure. • A linked list can grow or shrink in size as the program runs. • because the nodes in a linked list are dynamically allocated.
  • 4. Single link list – Singular link list • Linear collection of data items • Visiting the elements be from start side to end side • Y this is called one way link list • Each node consist of two nodes ,first contain data and the second contain the pointer to next • The last node consist pointer NULL while start variable contain address of first element ,it is also called list pointer variable
  • 6. Link list operations • The important operations are • Traversing – It is visited form start to end when NULL occur ,so visiting each element is called traversing • Insertion – How to insert a new item in list , at beginning ,at the End , and it Middle • Deletion – How to Delete an item in list , at beginning ,at the End , and it Middle • Searching – To search for an item in the list. • Sorting – So sort the elements in an order…
  • 7. Representation in Memory • The items of link list are stored in memory in scattered form but these are linked through pointers • Each item is called an object ,while each object contain at least two fields ,one for to store the data while other one is for next node address
  • 8. Circular link list • A link list in which the last node of the list points back to the first node of the list is called circular link list
  • 9. Double Link list • A list in which each node has the address both of next and previous node is called Double Link list • It can be visited in both directions • In singular list we can’t go back from current node to previous node .while we can in double l.list • Its also called two way list • Each node consist of three field • One store the data • 2nd store the address of previous node • 3rd store the address of next node
  • 10.
  • 11. Double Link list operations • The important operations are • Traversing – It is visited form start to end when NULL occur ,so visiting each element is called traversing ,we do in both directions • Insertion – How to insert a new item in list , at beginning ,at the End , and it Middle • Deletion – How to Delete an item in list , at beginning ,at the End , and it Middle • Searching – To search for an item in the list as array • Sorting – So sort the elements in an order…
  • 12. • Operation Name Description • createList() Create a new list (presumably empty) • copy() Set one list to be a copy of another • clear(); Clear a list (remove all elements) • insert(X, ?) Insert element X at a particular position in the list • remove(?) Remove element at some position in the list • get(?) Get element at a given position • update(X, ?) Replace the element at a given position with X • find(X) Determine if the element X is in the list • length() Returns the length of the list.
  • 13. • Functions Description • start() Moves the “current” pointer to the very first element • tail() Moves the “current” pointer to the very last element • next() Move the current position forward one element • back() Move the current position backward one element