Doubly Linked List 1.) In doubly linked list each node contains two pointers. 2.) which points has a reference to both the next point and pervious point of node in list. 3.) A doubly linked list is a two-way list because one can move in either from left to right or from right to left
Info prev next NODE Node Data Info : the user’s data. Prev, Next : the address of next and previous node in list
Operations on a Doubly linked list Create list . Insert element at beginning in list. Insert element at end in list. Insert element at any place in list. Delete element from the beginning of list. Delete element from the end of list. Delete element from any place from list.
Create doubly linked list NULL 7 X Create One another node 9 X X
Insert an element at beginning doubly linked list
Delete an element at any place doubly linked list
Doubly Linked list Advantages 1. We can traverse in both directions i.e. from starting to end and as well as from end to starting. 2. It is easy to reverse the linked list. 3. If we are at a node, then we can go to any node. But in linear linked list, it is not possible to reach the previous node. Disadvantages 1. It requires more space per space per node because one extra field is required for pointer to previous node. 2. Insertion and deletion take more time than linear linked list because more pointer operations are required than linear linked list.