Course Hive
Search

Welcome

Sign in or create your account

Continue with Google
or
Doubly Linked List | Program | Deletion Operation | Data Structures
Play lesson

Data Structures | Python - Doubly Linked List | Program | Deletion Operation | Data Structures

4.0 (0)
17 learners

What you'll learn

This course includes

  • 19.3 hours of video
  • Certificate of completion
  • Access on mobile and TV

Summary

Keywords

Full Transcript

In this Python Programming video tutorial you will learn about doubly Linked List data structure and also you will write the program for deletion operation in detail. Data structure is a way of storing and organising the data so that it can be accessed effectively. Linked List is a linear data structure made up of chain of nodes in which each node contains a data field and link or reference. There are different types of linked list. Here we will discuss about 3 common types of linked list. doubly linked list is one of them. Here we will discuss doubly linked list operations and definitions in detail. Here we will write 3 methods for deletion operation. def delete_begin(self): if self.head is None: print("DLL is empty can't delte !") return if self.head.nref is None: self.head = None print("DLL is empty after deleting the node!") else: self.head = self.head.nref self.head.pref = None def delete_end(self): if self.head is None: print("DLL is empty can't delte !") return if self.head.nref is None: self.head = None print("DLL is empty after deleting the node!") else: n = self.head while n.nref is not None: n = n.nref n.pref.nref = None def delete_by_value(self,x): if self.head is None: print("DLL is empty can't delte !") return if self.head.nref is None: if x==self.head.data: self.head = None else: print("x is not present in DLL") return if self.head.data == x: self.head = self.head.nref self.head.pref = None return n = self.head while n.nref is not None: if x==n.data: break n = n.nref if n.nref is not None: n.nref.pref = n.pref n.pref.nref = n.nref else: if n.data==x: n.pref.nref = None else: print("x is not present in dll!") #DataStructures #PythonPrograms #LinkedList For more free tutorials on computer programming http://www.facebook.com/AmulsAcademy twitter.com/AmulsAcademy

Course Hive

Continue this lesson in the app

Install CourseHive on Android or iOS to keep learning while you move.

Related Courses

FAQs

Course Hive
Download CourseHive
Keep learning anywhere