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 traversing 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 two methods for traversing operation, one is for forward traversing and another for backward traversing. Forward Traversing: def print_LL(self): if self.head is None: print("Linked List is empty!") else: n = self.head while n is not None: print(n.data) n = n.nref Backward Traversing: def print_LL_reverse(self): print() if self.head is None: print("Linked List is empty!") else: n = self.head while n.nref is not None: n = n.nref while n is not None: print(n.data) n = n.pref #DataStructures #PythonPrograms #LinkedList For more free tutorials on computer programming http://www.facebook.com/AmulsAcademy twitter.com/AmulsAcademy
