SlideShare ist ein Scribd-Unternehmen logo
1 von 13
Definition


Doubly is a type of linked list that
allows us to go in both directions

               and            in a linked list.




       Powerpoint Templates
                                       Page 3
A node in a doubly linked list
stores two references:
  - a next link, which points to the
    next node in the list,
  - a prev link, which points to the
     previous node in the list.




       Powerpoint Templates
                                   Page 4
Such lists allow for :
a great variety of quick update
operations, including insertion and
removal at both ends, and in the
middle.



          Powerpoint Templates
                                  Page 5
Header and Trailer Sentinels

      To simplify programming,
         it is convenient to add special nodes at
         both ends of a doubly linked list:
      • The header has a valid next
        reference but a null prev reference,
      • while the trailer has a valid prev
        reference but a null next reference.
       What is the Sentinels?
   A sentinel nodes do not store any elements.
and second name for sentinels node is “ Dummy ”

             Powerpoint Templates
                                                Page 6
Doubly Linked Lists
Figure 3.14:      A doubly linked list with sentinels, header and trailer,
   marking the ends of the list. An empty list would have these sentinels
   pointing to each other. We do not show the null prev pointer for the
   header nor do we show the null next pointer for the trailer.




                Powerpoint Templates
                                                               Page 7
Implementation
Deletion
Figure 3.15:      Removing the node at the end of a a doubly linked list with
header and trailer sentinels: (a) before deleting at the tail; (b) deleting at
the tail; (c) after the deletion.
Deletion
Code Fragment 3.18: Removing the last node of a doubly linked list. Variable
  size keeps track of the current number of elements in the list. Note that this
  method works also if the list has size one.
Insertion
Figure 3.16:       Adding an element at the front: (a)
during; (b) after.
Insertion
Code Fragment 3.19: Inserting a new node v at the beginning of a doubly
linked list. Variable size keeps track of the current number of elements in
the list. Note that this method works also on an empty list.
Powerpoint Templates
                       Page 13

Weitere ähnliche Inhalte

Was ist angesagt?

Linked stacks and queues
Linked stacks and queuesLinked stacks and queues
Linked stacks and queuesRamzi Alqrainy
 
linked list in data structure
linked list in data structure linked list in data structure
linked list in data structure shameen khan
 
Doubly & Circular Linked Lists
Doubly & Circular Linked ListsDoubly & Circular Linked Lists
Doubly & Circular Linked ListsAfaq Mansoor Khan
 
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
 
Binary Search Tree
Binary Search TreeBinary Search Tree
Binary Search Treesagar yadav
 
Data Structures - Lecture 9 [Stack & Queue using Linked List]
 Data Structures - Lecture 9 [Stack & Queue using Linked List] Data Structures - Lecture 9 [Stack & Queue using Linked List]
Data Structures - Lecture 9 [Stack & Queue using Linked List]Muhammad Hammad Waseem
 
DOUBLE LINKED LIST(DATA STRUCTURE) PPT BY PRASUN KUMAR
DOUBLE LINKED LIST(DATA STRUCTURE) PPT BY PRASUN KUMARDOUBLE LINKED LIST(DATA STRUCTURE) PPT BY PRASUN KUMAR
DOUBLE LINKED LIST(DATA STRUCTURE) PPT BY PRASUN KUMARPrasunKumar38
 
1.1 binary tree
1.1 binary tree1.1 binary tree
1.1 binary treeKrish_ver2
 
Data Structures - Lecture 7 [Linked List]
Data Structures - Lecture 7 [Linked List]Data Structures - Lecture 7 [Linked List]
Data Structures - Lecture 7 [Linked List]Muhammad Hammad Waseem
 
Linked list
Linked listLinked list
Linked listVONI
 
Data Structures- Part7 linked lists
Data Structures- Part7 linked listsData Structures- Part7 linked lists
Data Structures- Part7 linked listsAbdullah Al-hazmy
 
Data structure - Graph
Data structure - GraphData structure - Graph
Data structure - GraphMadhu Bala
 
Operations on linked list
Operations on linked listOperations on linked list
Operations on linked listSumathi Kv
 

Was ist angesagt? (20)

Linked stacks and queues
Linked stacks and queuesLinked stacks and queues
Linked stacks and queues
 
B and B+ tree
B and B+ treeB and B+ tree
B and B+ tree
 
linked list in data structure
linked list in data structure linked list in data structure
linked list in data structure
 
Linear data structure concepts
Linear data structure conceptsLinear data structure concepts
Linear data structure concepts
 
single linked list
single linked listsingle linked list
single linked list
 
Linked lists
Linked listsLinked lists
Linked lists
 
Doubly & Circular Linked Lists
Doubly & Circular Linked ListsDoubly & Circular Linked Lists
Doubly & Circular Linked Lists
 
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...
 
Binary Search Tree
Binary Search TreeBinary Search Tree
Binary Search Tree
 
Data Structures - Lecture 9 [Stack & Queue using Linked List]
 Data Structures - Lecture 9 [Stack & Queue using Linked List] Data Structures - Lecture 9 [Stack & Queue using Linked List]
Data Structures - Lecture 9 [Stack & Queue using Linked List]
 
DOUBLE LINKED LIST(DATA STRUCTURE) PPT BY PRASUN KUMAR
DOUBLE LINKED LIST(DATA STRUCTURE) PPT BY PRASUN KUMARDOUBLE LINKED LIST(DATA STRUCTURE) PPT BY PRASUN KUMAR
DOUBLE LINKED LIST(DATA STRUCTURE) PPT BY PRASUN KUMAR
 
1.1 binary tree
1.1 binary tree1.1 binary tree
1.1 binary tree
 
Data Structures - Lecture 7 [Linked List]
Data Structures - Lecture 7 [Linked List]Data Structures - Lecture 7 [Linked List]
Data Structures - Lecture 7 [Linked List]
 
Linked list
Linked listLinked list
Linked list
 
Data Structures- Part7 linked lists
Data Structures- Part7 linked listsData Structures- Part7 linked lists
Data Structures- Part7 linked lists
 
Stack
StackStack
Stack
 
Linked list
Linked listLinked list
Linked list
 
Data structure - Graph
Data structure - GraphData structure - Graph
Data structure - Graph
 
Linked list
Linked list Linked list
Linked list
 
Operations on linked list
Operations on linked listOperations on linked list
Operations on linked list
 

Andere mochten auch

Individual-In-The-Loop (for Ethically Aligned Artificial Intelligence)
Individual-In-The-Loop (for Ethically Aligned Artificial Intelligence)Individual-In-The-Loop (for Ethically Aligned Artificial Intelligence)
Individual-In-The-Loop (for Ethically Aligned Artificial Intelligence)John C. Havens
 
Insertion and Deletion in Binary Search Trees (using Arrays and Linked Lists)
Insertion and Deletion in Binary Search Trees (using Arrays and Linked Lists)Insertion and Deletion in Binary Search Trees (using Arrays and Linked Lists)
Insertion and Deletion in Binary Search Trees (using Arrays and Linked Lists)Lovelyn Rose
 
Double linked list
Double linked listDouble linked list
Double linked listraviahuja11
 
358 33 powerpoint-slides_8-linked-lists_chapter-8
358 33 powerpoint-slides_8-linked-lists_chapter-8358 33 powerpoint-slides_8-linked-lists_chapter-8
358 33 powerpoint-slides_8-linked-lists_chapter-8sumitbardhan
 
Data structure using c module 1
Data structure using c module 1Data structure using c module 1
Data structure using c module 1smruti sarangi
 
6. Linked list - Data Structures using C++ by Varsha Patil
6. Linked list - Data Structures using C++ by Varsha Patil6. Linked list - Data Structures using C++ by Varsha Patil
6. Linked list - Data Structures using C++ by Varsha Patilwidespreadpromotion
 
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 StructureBalwant Gorad
 
Array implementation and linked list as datat structure
Array implementation and linked list as datat structureArray implementation and linked list as datat structure
Array implementation and linked list as datat structureTushar Aneyrao
 
Trees data structure
Trees data structureTrees data structure
Trees data structureSumit Gupta
 
Binary Search Tree
Binary Search TreeBinary Search Tree
Binary Search TreeAbhishek L.R
 
Open Legal Data Workshop at Stanford
Open Legal Data Workshop at StanfordOpen Legal Data Workshop at Stanford
Open Legal Data Workshop at StanfordHarry Surden
 
Harry Surden - Artificial Intelligence and Law Overview
Harry Surden - Artificial Intelligence and Law OverviewHarry Surden - Artificial Intelligence and Law Overview
Harry Surden - Artificial Intelligence and Law OverviewHarry Surden
 
AI and Machine Learning Demystified by Carol Smith at Midwest UX 2017
AI and Machine Learning Demystified by Carol Smith at Midwest UX 2017AI and Machine Learning Demystified by Carol Smith at Midwest UX 2017
AI and Machine Learning Demystified by Carol Smith at Midwest UX 2017Carol Smith
 

Andere mochten auch (18)

Linked list
Linked listLinked list
Linked list
 
Individual-In-The-Loop (for Ethically Aligned Artificial Intelligence)
Individual-In-The-Loop (for Ethically Aligned Artificial Intelligence)Individual-In-The-Loop (for Ethically Aligned Artificial Intelligence)
Individual-In-The-Loop (for Ethically Aligned Artificial Intelligence)
 
Insertion and Deletion in Binary Search Trees (using Arrays and Linked Lists)
Insertion and Deletion in Binary Search Trees (using Arrays and Linked Lists)Insertion and Deletion in Binary Search Trees (using Arrays and Linked Lists)
Insertion and Deletion in Binary Search Trees (using Arrays and Linked Lists)
 
Cyber Crime
Cyber CrimeCyber Crime
Cyber Crime
 
Double linked list
Double linked listDouble linked list
Double linked list
 
358 33 powerpoint-slides_8-linked-lists_chapter-8
358 33 powerpoint-slides_8-linked-lists_chapter-8358 33 powerpoint-slides_8-linked-lists_chapter-8
358 33 powerpoint-slides_8-linked-lists_chapter-8
 
Data structure using c module 1
Data structure using c module 1Data structure using c module 1
Data structure using c module 1
 
6. Linked list - Data Structures using C++ by Varsha Patil
6. Linked list - Data Structures using C++ by Varsha Patil6. Linked list - Data Structures using C++ by Varsha Patil
6. Linked list - Data Structures using C++ by Varsha Patil
 
7 Myths of AI
7 Myths of AI7 Myths of AI
7 Myths of AI
 
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
 
Linked list
Linked listLinked list
Linked list
 
Array implementation and linked list as datat structure
Array implementation and linked list as datat structureArray implementation and linked list as datat structure
Array implementation and linked list as datat structure
 
linked list
linked list linked list
linked list
 
Trees data structure
Trees data structureTrees data structure
Trees data structure
 
Binary Search Tree
Binary Search TreeBinary Search Tree
Binary Search Tree
 
Open Legal Data Workshop at Stanford
Open Legal Data Workshop at StanfordOpen Legal Data Workshop at Stanford
Open Legal Data Workshop at Stanford
 
Harry Surden - Artificial Intelligence and Law Overview
Harry Surden - Artificial Intelligence and Law OverviewHarry Surden - Artificial Intelligence and Law Overview
Harry Surden - Artificial Intelligence and Law Overview
 
AI and Machine Learning Demystified by Carol Smith at Midwest UX 2017
AI and Machine Learning Demystified by Carol Smith at Midwest UX 2017AI and Machine Learning Demystified by Carol Smith at Midwest UX 2017
AI and Machine Learning Demystified by Carol Smith at Midwest UX 2017
 

Ähnlich wie Doubly linked list (20)

linked list
linked list linked list
linked list
 
Linked list.pptx
Linked list.pptxLinked list.pptx
Linked list.pptx
 
csc211_lecture_21.pptx
csc211_lecture_21.pptxcsc211_lecture_21.pptx
csc211_lecture_21.pptx
 
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 (introduction) 1
Linked list (introduction) 1Linked list (introduction) 1
Linked list (introduction) 1
 
Linked list
Linked listLinked list
Linked list
 
Double link list
Double link listDouble link list
Double link list
 
Linked Lists.pdf
Linked Lists.pdfLinked Lists.pdf
Linked Lists.pdf
 
Linked List
Linked ListLinked List
Linked List
 
Lecture3
Lecture3Lecture3
Lecture3
 
Lecture3
Lecture3Lecture3
Lecture3
 
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(Part 1)
Data Structures(Part 1)Data Structures(Part 1)
Data Structures(Part 1)
 
Link list part 1
Link list part 1Link list part 1
Link list part 1
 
Unit 1 linked list
Unit 1 linked listUnit 1 linked list
Unit 1 linked list
 
Static arrays are structures whose size is fixed at compile time and.pdf
Static arrays are structures whose size is fixed at compile time and.pdfStatic arrays are structures whose size is fixed at compile time and.pdf
Static arrays are structures whose size is fixed at compile time and.pdf
 
Linked List.pptx
Linked List.pptxLinked List.pptx
Linked List.pptx
 
Unit 3 dsa LINKED LIST
Unit 3 dsa LINKED LISTUnit 3 dsa LINKED LIST
Unit 3 dsa LINKED LIST
 
Linked lists by ammara siddiqui
Linked lists by ammara siddiquiLinked lists by ammara siddiqui
Linked lists by ammara siddiqui
 

Mehr von Fahd Allebdi

ترتيل - جمعية تحفيظ القرآن الكريم بخليص
ترتيل - جمعية تحفيظ القرآن الكريم بخليصترتيل - جمعية تحفيظ القرآن الكريم بخليص
ترتيل - جمعية تحفيظ القرآن الكريم بخليصFahd Allebdi
 
twitter hacking causes and protection
twitter hacking causes and protectiontwitter hacking causes and protection
twitter hacking causes and protectionFahd Allebdi
 
Wireless routers Presentation
Wireless routers PresentationWireless routers Presentation
Wireless routers PresentationFahd Allebdi
 
تعليم اللغة الانجليزية
تعليم اللغة الانجليزيةتعليم اللغة الانجليزية
تعليم اللغة الانجليزيةFahd Allebdi
 
كنوز من أقوال العلماء
كنوز من أقوال العلماءكنوز من أقوال العلماء
كنوز من أقوال العلماءFahd Allebdi
 

Mehr von Fahd Allebdi (6)

ترتيل - جمعية تحفيظ القرآن الكريم بخليص
ترتيل - جمعية تحفيظ القرآن الكريم بخليصترتيل - جمعية تحفيظ القرآن الكريم بخليص
ترتيل - جمعية تحفيظ القرآن الكريم بخليص
 
twitter hacking causes and protection
twitter hacking causes and protectiontwitter hacking causes and protection
twitter hacking causes and protection
 
Machine learning
Machine learningMachine learning
Machine learning
 
Wireless routers Presentation
Wireless routers PresentationWireless routers Presentation
Wireless routers Presentation
 
تعليم اللغة الانجليزية
تعليم اللغة الانجليزيةتعليم اللغة الانجليزية
تعليم اللغة الانجليزية
 
كنوز من أقوال العلماء
كنوز من أقوال العلماءكنوز من أقوال العلماء
كنوز من أقوال العلماء
 

Kürzlich hochgeladen

Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17Celine George
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsKarakKing
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxmarlenawright1
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Pooja Bhuva
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxCeline George
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxJisc
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 

Kürzlich hochgeladen (20)

Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 

Doubly linked list

  • 1.
  • 2.
  • 3. Definition Doubly is a type of linked list that allows us to go in both directions and in a linked list. Powerpoint Templates Page 3
  • 4. A node in a doubly linked list stores two references: - a next link, which points to the next node in the list, - a prev link, which points to the previous node in the list. Powerpoint Templates Page 4
  • 5. Such lists allow for : a great variety of quick update operations, including insertion and removal at both ends, and in the middle. Powerpoint Templates Page 5
  • 6. Header and Trailer Sentinels To simplify programming, it is convenient to add special nodes at both ends of a doubly linked list: • The header has a valid next reference but a null prev reference, • while the trailer has a valid prev reference but a null next reference. What is the Sentinels? A sentinel nodes do not store any elements. and second name for sentinels node is “ Dummy ” Powerpoint Templates Page 6
  • 7. Doubly Linked Lists Figure 3.14: A doubly linked list with sentinels, header and trailer, marking the ends of the list. An empty list would have these sentinels pointing to each other. We do not show the null prev pointer for the header nor do we show the null next pointer for the trailer. Powerpoint Templates Page 7
  • 9. Deletion Figure 3.15: Removing the node at the end of a a doubly linked list with header and trailer sentinels: (a) before deleting at the tail; (b) deleting at the tail; (c) after the deletion.
  • 10. Deletion Code Fragment 3.18: Removing the last node of a doubly linked list. Variable size keeps track of the current number of elements in the list. Note that this method works also if the list has size one.
  • 11. Insertion Figure 3.16: Adding an element at the front: (a) during; (b) after.
  • 12. Insertion Code Fragment 3.19: Inserting a new node v at the beginning of a doubly linked list. Variable size keeps track of the current number of elements in the list. Note that this method works also on an empty list.