Doubly Linked List Data Structure all Operations | C++ Program to Implement Doubly Linked List

In this tutorial we will understand the working of Doubly Linked List & see all operations of Doubly Linked List. If you don’t know what a Linked List Data Structure is please check this post.

Doubly Linked list is a type of Linked List Data structure which behaves like a two way list/chain. The reason it is called a two way list or two way chain is because we can traverse this list in two directions 

  • start from the head node to the end.
  • go back in the reverse direction.

doubly linked list diagram

As you can see from the diagram, each node object has 1 data field & 2 pointer fields. The data field contains the actual data where as the pointer fields(next & previous pointers) points to the next node & previous node in the doubly linked list. Since the nodes are not stored in contiguous memory locations, these extra pointer fields assists in locating the next & previous nodes in memory. As we have 2 pointers: one pointing to the next node and one pointing to the previous node, we can traverse in 2 directions starting from the head node to the end and vice versa.

Following are the standard Singly Linked List Operations –

  • Traverse – Iterate through the nodes in the linked list starting from the head node.
  • Append – Attach a new node (to the end) of a list
  • Prepend – Attach a new node (to the beginning) of the list
  • Insert – attach a new node to a specific position on the list
  • Delete – Remove/Delink a node from the list
  • Count – Returns the no of nodes in linked list
C++ Program to Implement Doubly Linked List – 
YouTube video tutorials –
Doubly Linked List Data Structure | Theory & Algorithm –
C++ Program to Implement Doubly Linked List –

Leave a Reply

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