Doubly linked list : C Programming



Doubly Linked List : Traverse Bi-directional

  1. In Doubly Linked List , each node contain two address fields .
  2. One address field for storing address of next node to be followed and second address field contain address of previous node linked to it.
  3. So Two way access is possible i.e We can start accessing nodes from start as well as from last .
  4. Like Singly Linked List also only Linear but Bidirectional Sequential movement is possible.
  5. Elements are accessed sequentially , no direct access is allowed.

Doubly Linked List in Programming Data Structure

Explanation :

  1. Doubly Linked List is most useful type of Linked List.
  2. In DLL we have facility to access both next as well as previous data using “next link” and “previous link“.
  3. In the above diagram , suppose we are currently on 2nd node i.e at 4 then we can access next and previous data using -
To Access Next Data : curr_node->next->data
To Access Previous Data : curr_node->previous->data
  1. We have to always maintain start node , because it is the only node that is used to keep track of complete linked list.