Doubly or Two Way Linked List

Two Way Linked List :

  • Doubly Linked List or Two Way Linked List is also a linear arrangement of data elements.
  • It is called two way linked list as it can be traversed in both the directions, backwards and forward
  • In this each node keeps track of its previous and next nodes.
  • So, every node contains three parts : INFO part to store data, PREV pointer to store address of previous node and NEXT pointer.
  • List has a FIRST and LAST pointer. FIRST points to the first node in the list. LAST points to the last node in the list.
  • The PREV pointer field of first node and the NEXT pointer field of the last node contains NULL value. It signifies the end of list on both sides.

Leave a Reply

Your email address will not be published. Required fields are marked *